Skip to content

Commit ecf96a6

Browse files
author
Ivo Georgiev
committed
Fix: from_secs replaced with from_millis
1 parent 4ff73ff commit ecf96a6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

sentry/src/event_aggregator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl EventAggregator {
103103
break;
104104
}
105105

106-
delay_for(Duration::from_secs(aggr_throttle as u64)).await;
106+
delay_for(Duration::from_millis(aggr_throttle as u64)).await;
107107
store(&dbpool, &channel_id, &logger, recorder.clone()).await;
108108
}
109109
});

validator_worker/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ fn run<A: Adapter + 'static>(
149149
async fn infinite<A: Adapter + 'static>(args: Args<A>, logger: &Logger) {
150150
loop {
151151
let arg = args.clone();
152-
let delay_future = delay_for(Duration::from_secs(arg.config.wait_time as u64));
152+
let delay_future = delay_for(Duration::from_millis(arg.config.wait_time as u64));
153153
let _result = join(iterate_channels(arg, logger), delay_future).await;
154154
}
155155
}
@@ -194,7 +194,7 @@ async fn validator_tick<A: Adapter + 'static>(
194194
let whoami = adapter.whoami().clone();
195195
// Cloning the `Logger` is cheap, see documentation for more info
196196
let sentry = SentryApi::init(adapter, &channel, &config, logger.clone())?;
197-
let duration = Duration::from_secs(config.validator_tick_timeout as u64);
197+
let duration = Duration::from_millis(config.validator_tick_timeout as u64);
198198

199199
match channel.spec.validators.find(&whoami) {
200200
SpecValidator::Leader(_) => {

validator_worker/src/sentry_interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ impl<T: Adapter + 'static> SentryApi<T> {
3434
logger: Logger,
3535
) -> Result<Self, ValidatorWorker> {
3636
let client = Client::builder()
37-
.timeout(Duration::from_secs(config.fetch_timeout.into()))
37+
.timeout(Duration::from_millis(config.fetch_timeout.into()))
3838
.build()
3939
.map_err(|e| ValidatorWorker::Failed(format!("building Client error: {}", e)))?;
4040

0 commit comments

Comments
 (0)