Skip to content

Commit

Permalink
feat(migrate-from-gcs): retry warn error log
Browse files Browse the repository at this point in the history
  • Loading branch information
alextes committed Oct 16, 2023
1 parent 859b60e commit c94dc35
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/bin/migrate-from-gcs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use object_store::{
use serde::Serialize;
use tokio::{spawn, task::spawn_blocking, time::interval};
use tokio_util::io::{StreamReader, SyncIoBridge};
use tracing::{debug, info};
use tracing::{debug, error, info, warn};

const PROGRESS_FILE_PATH: &str = "progress.json";

Expand Down Expand Up @@ -289,10 +289,11 @@ async fn main() -> anyhow::Result<()> {
let bytes_gz_shared = Bytes::from(bytes_gz);
while let Err(err) = ovh.put(&path, bytes_gz_shared.clone()).await {
if let Some(wait) = backoff.next_backoff() {
warn!("failed to execute OVH put operation: {}, retrying", err);
tokio::time::sleep(wait).await;
continue;
}
eprintln!("failed to execute OVH put operation: {}", err);
error!("failed to execute OVH put operation: {}", err);
break;
}

Expand Down

0 comments on commit c94dc35

Please sign in to comment.