diff --git a/server/app/Cargo.toml b/server/app/Cargo.toml index ea82a39..b3de4ef 100644 --- a/server/app/Cargo.toml +++ b/server/app/Cargo.toml @@ -5,7 +5,7 @@ edition = "2021" [dependencies] anyhow = "1.0.89" -sqlx = {version = "0.8.2", features = ["mysql", "runtime-tokio", "uuid", "time"]} +sqlx = {version = "0.8.2", features = ["mysql", "runtime-tokio", "uuid", "chrono"]} tokio = {version = "1.40.0", features = ["rt"]} openapi = {path = "../apis"} axum = "0.7.6" diff --git a/server/app/src/repo/polling.rs b/server/app/src/repo/polling.rs index 14ca42f..d3167cc 100644 --- a/server/app/src/repo/polling.rs +++ b/server/app/src/repo/polling.rs @@ -1,10 +1,10 @@ use anyhow::{Ok, Result}; -use sqlx::{query, query_as, types::time::PrimitiveDateTime}; +use sqlx::{query, query_as, types::chrono::NaiveDateTime}; use super::Repository; struct Polling { - last: PrimitiveDateTime, + last: NaiveDateTime, } impl Repository { @@ -13,7 +13,7 @@ impl Repository { .fetch_one(&self.pool) .await?; - Ok(result.last.to_string()) + Ok(result.last.and_utc().to_string()) } pub async fn record_time(&self, checkpoint: String) -> Result<()> {