Uncomment sync_scores, format
This commit is contained in:
13
src/db.rs
13
src/db.rs
@ -91,18 +91,19 @@ fn get_all_games(conn: Connection, all_teams: HashMap<String, Team>) -> GamesRes
|
||||
fn update_game_sqlite(conn: Connection, game: Game) -> Result<(), rusqlite::Error> {
|
||||
let update_query = Query::update()
|
||||
.table("games")
|
||||
.values([("start_time", game.start_time.into()), ("end_time", game.end_time.into())])
|
||||
.values([
|
||||
("start_time", game.start_time.into()),
|
||||
("end_time", game.end_time.into()),
|
||||
])
|
||||
.and_where(Expr::col("code").eq(game.code))
|
||||
.to_owned();
|
||||
let mut update_stmt = conn.prepare(
|
||||
&update_query.to_string(SqliteQueryBuilder)
|
||||
)?;
|
||||
|
||||
let mut update_stmt = conn.prepare(&update_query.to_string(SqliteQueryBuilder))?;
|
||||
|
||||
let result = update_stmt.query([]);
|
||||
|
||||
match result {
|
||||
Ok(_) => Ok(()),
|
||||
Err(error) => Err(error)
|
||||
Err(error) => Err(error),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -210,7 +210,7 @@ async fn main() -> std::io::Result<()> {
|
||||
games: state.clone(),
|
||||
}
|
||||
.start();
|
||||
//sync_scores(actor_addr.clone()).await;
|
||||
sync_scores(actor_addr.clone()).await;
|
||||
HttpServer::new(move || {
|
||||
App::new()
|
||||
.app_data(web::Data::new(pool.clone()))
|
||||
|
||||
Reference in New Issue
Block a user