Skip to content

Commit ee80eb0

Browse files
authored
Refactor nack duration handling in EoaExecutorWorker (#45)
- Updated the nack duration for work remaining to be conditional based on account type, setting it to 2 seconds for minimal accounts and 200 milliseconds for others. This change aims to enhance responsiveness in error handling and optimize transaction processing times.
1 parent 9913fda commit ee80eb0

File tree

1 file changed

+7
-1
lines changed
  • executors/src/eoa/worker

1 file changed

+7
-1
lines changed

executors/src/eoa/worker/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,15 @@ where
208208
let job_duration = calculate_duration_seconds(job_start_time, job_end_time);
209209
record_eoa_job_processing_time(data.chain_id, job_duration);
210210

211+
let delay = if is_minimal_account {
212+
Some(Duration::from_secs(2))
213+
} else {
214+
Some(Duration::from_millis(200))
215+
};
216+
211217
if result.is_work_remaining() {
212218
Err(EoaExecutorWorkerError::WorkRemaining { result })
213-
.map_err_nack(Some(Duration::from_millis(200)), RequeuePosition::Last)
219+
.map_err_nack(delay, RequeuePosition::Last)
214220
} else {
215221
Ok(result)
216222
}

0 commit comments

Comments
 (0)