mirror of
https://codeberg.org/icewind/log-archiver.git
synced 2026-06-03 17:44:06 +02:00
flake reorg
This commit is contained in:
parent
a650f7f970
commit
db5cef6fb7
10 changed files with 109 additions and 85 deletions
|
|
@ -44,7 +44,7 @@ async fn main() -> Result<(), MainError> {
|
|||
|
||||
async fn get_last_demo(client: &Client, api_host: &str) -> Result<i32, MainError> {
|
||||
let response: Response = client
|
||||
.get(&format!("{}/api/v1/log?limit=100", api_host))
|
||||
.get(format!("{}/api/v1/log?limit=100", api_host))
|
||||
.send()
|
||||
.await?;
|
||||
let listing: LogListing = serde_json::from_str(&response.text().await?)?;
|
||||
|
|
@ -85,7 +85,7 @@ async fn archive(database_url: &str, api_host: &str, log_target: &Path) -> Resul
|
|||
sleep(Duration::from_millis(500)).await;
|
||||
|
||||
let response: Response = client
|
||||
.get(&format!("{}/api/v1/log/{}", api_host, last_archived))
|
||||
.get(format!("{}/api/v1/log/{}", api_host, last_archived))
|
||||
.send()
|
||||
.await?;
|
||||
let body: Value = serde_json::from_str(&response.text().await?)?;
|
||||
|
|
@ -111,7 +111,7 @@ async fn download_log(
|
|||
id: i32,
|
||||
) -> Result<(), MainError> {
|
||||
let log_zip = client
|
||||
.get(&format!("{}/logs/log_{}.log.zip", api_host, id))
|
||||
.get(format!("{}/logs/log_{}.log.zip", api_host, id))
|
||||
.send()
|
||||
.await?
|
||||
.bytes()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue