mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: fix checklist potential panic (#5561)
* chore: fix checklist * chore: fix checklist
This commit is contained in:
@ -34,7 +34,8 @@ impl TaskQueue {
|
||||
match self.index_tasks.entry(task.handler_id.clone()) {
|
||||
Entry::Occupied(entry) => {
|
||||
let mut list = entry.get().borrow_mut();
|
||||
assert!(list
|
||||
|
||||
debug_assert!(list
|
||||
.peek()
|
||||
.map(|old_id| pending_task.id >= old_id.id)
|
||||
.unwrap_or(true));
|
||||
|
@ -45,7 +45,7 @@ impl TaskStore {
|
||||
}
|
||||
|
||||
pub(crate) fn next_task_id(&self) -> TaskId {
|
||||
let _ = self.task_id_counter.fetch_add(1, SeqCst);
|
||||
self.task_id_counter.load(SeqCst)
|
||||
let old = self.task_id_counter.fetch_add(1, SeqCst);
|
||||
old + 1
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user