Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
lizixian committed Aug 10, 2022
1 parent db13420 commit a2fc278
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,10 @@ class OptimusTaskManager {
private suspend fun sendTask(task: IOptimusTask): Boolean {
return runCatching {
if (checkChannelActive()) {
return if (!TaskQueueManager.hasTask(task)) {
task.setSequence(atomicInteger.incrementAndGet())
TaskQueueManager.addTask(task)
channel.send(task)
true
} else {
false
}
task.setSequence(atomicInteger.incrementAndGet())
TaskQueueManager.addTask(task)
channel.send(task)
return true
} else {
TaskQueueManager.removeTask(task)
cacheTaskNameList.remove(task.getTaskName())
Expand Down

0 comments on commit a2fc278

Please sign in to comment.