We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d2da9d commit b38e788Copy full SHA for b38e788
src/transaction/engine.rs
@@ -142,12 +142,17 @@ impl Engine {
142
}
143
144
// Spawn a task for each interval group
145
- for (interval_duration, transaction_kinds) in interval_groups {
+ for (task_id, (interval_duration, transaction_kinds)) in interval_groups.into_iter().enumerate() {
146
let opts_clone = opts.clone();
147
let metrics_clone = metrics.clone();
148
let transactions_clone = transactions.clone();
149
150
tasks.spawn(async move {
151
+ // Add 2 second delay between each interval group start
152
+ if task_id > 0 {
153
+ tokio::time::sleep(tokio::time::Duration::from_secs(5 * task_id as u64)).await;
154
+ }
155
+
156
let mut interval = interval(interval_duration);
157
loop {
158
interval.tick().await;
0 commit comments