Skip to content

Commit

Permalink
sqlx feature flag: time -> chrono
Browse files Browse the repository at this point in the history
  • Loading branch information
Pugma committed Oct 3, 2024
1 parent b70d625 commit 0452623
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion server/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions server/app/src/repo/polling.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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<()> {
Expand Down

0 comments on commit 0452623

Please sign in to comment.