Skip to content

Commit

Permalink
Fix Docker workflow for k-line updater. K-line updater sleep period i…
Browse files Browse the repository at this point in the history
…ncrease.
  • Loading branch information
kukabi committed Jun 21, 2024
1 parent 90ff44d commit a7c50ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion _config/base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ user_registration_per_ip_limit = 10

[kline_updater]
tmp_dir_path = "/path/to/the/temporary/image/dir"
sleep_seconds = 10
sleep_seconds = 86400
begin_year = 2022
begin_month = 1
begin_day = 1
1 change: 1 addition & 0 deletions _docker/base/01-subvt-backend-lib.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ RUN cargo build --release
# copy executables
RUN cp target/release/subvt-app-service /subvt/bin/ \
&& cp target/release/subvt-block-processor /subvt/bin/ \
&& cp target/release/subvt-kline-updater /subvt/bin/ \
&& cp target/release/subvt-network-status-server /subvt/bin/ \
&& cp target/release/subvt-network-status-updater /subvt/bin/ \
&& cp target/release/subvt-notification-generator /subvt/bin/ \
Expand Down
3 changes: 2 additions & 1 deletion subvt-kline-updater/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,14 @@ impl Service for KLineUpdater {
// delete temp files
let _ = std::fs::remove_file(&zip_file_local_path);
let _ = std::fs::remove_file(&csv_file_local_path);
// publish metrics
metrics::kline_count().set(postgres.get_kline_count().await? as i64);
}
// publish total count
log::info!(
"K-line updater completed. Will sleep for {} seconds",
sleep_seconds
);
metrics::kline_count().set(postgres.get_kline_count().await? as i64);
tokio::time::sleep(std::time::Duration::from_secs(sleep_seconds)).await;
}
}
Expand Down

0 comments on commit a7c50ad

Please sign in to comment.