bumb dependencies

This commit is contained in:
Robin Appelman 2021-02-27 14:49:39 +01:00
commit 6f1f50f0f0
4 changed files with 701 additions and 460 deletions

1197
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -5,11 +5,11 @@ authors = ["Robin Appelman <robin@icewind.nl>"]
edition = "2018"
[dependencies]
sqlx = { version = "0.3.2", default_features = false, features = ["macros", "postgres", "json", "runtime-tokio"] }
dotenv = "0.15.0"
main_error = "0.1.0"
tokio = { version = "0.2.13", features = ["macros", "time"] }
reqwest = { version = "0.10.4", features = [] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
sqlx = { version = "0.5", default_features = false, features = ["macros", "postgres", "json", "runtime-actix-rustls"] }
dotenv = "0.15"
main_error = "0.1"
tokio = { version = "1", features = ["macros", "time"] }
reqwest = { version = "0.11", default-features = false , features = ["rustls-tls"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
chrono = { version = "0.4", features = ["serde"] }

View file

@ -5,7 +5,7 @@ RUN sudo chown -R rust:rust .
RUN cargo build --release
FROM alpine:latest
FROM scratch
COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/log-archiver /

View file

@ -5,7 +5,7 @@ use serde::Deserialize;
use serde_json::Value;
use sqlx::postgres::PgPool;
use std::time::Duration;
use tokio::time::delay_for;
use tokio::time::sleep;
#[tokio::main]
async fn main() -> Result<(), MainError> {
@ -18,7 +18,7 @@ async fn main() -> Result<(), MainError> {
eprintln!("{:?}", e);
}
delay_for(Duration::from_secs(60)).await;
sleep(Duration::from_secs(60)).await;
}
}
@ -44,7 +44,7 @@ async fn get_last_demo(client: &Client, api_base: &str) -> Result<i32, MainError
}
async fn archive(database_url: &str, api_base: &str) -> Result<(), MainError> {
let pool = PgPool::builder().max_size(2).build(database_url).await?;
let pool = PgPool::connect(database_url).await?;
let client = reqwest::Client::new();
@ -62,7 +62,7 @@ async fn archive(database_url: &str, api_base: &str) -> Result<(), MainError> {
println!("{}", last_archived);
delay_for(Duration::from_millis(200)).await;
sleep(Duration::from_millis(200)).await;
let response: Response = client
.get(&format!("{}/{}", api_base, last_archived))