Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ufoscout committed Mar 13, 2024
1 parent d4ffaee commit a90b4b4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ic-task-scheduler/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,12 @@ impl<T: 'static + Task, P: 'static + IterableUnboundedMapStructure<u32, InnerSch

Self::spawn(async move {
let now_timestamp_secs = time_secs();
let mut lock = task_scheduler.pending_tasks.lock();

if let Some(mut task) = lock.get(&task_key) {
let task = task_scheduler.pending_tasks.lock().get(&task_key);
if let Some(mut task) = task {
if let TaskStatus::Waiting { .. } = task.status {
task.status = TaskStatus::running(now_timestamp_secs);
lock.insert(&task_key, &task);
drop(lock);
task_scheduler.pending_tasks.lock().insert(&task_key, &task);

let completed_task =
match task.task.execute(Box::new(task_scheduler.clone())).await {
Expand Down

0 comments on commit a90b4b4

Please sign in to comment.