xcherryio / xcherry

server and main repo of xCherry project
Apache License 2.0
26 stars 1 forks source link

consider delete worker task on completion instead of batch deletion #58

Closed longquanzheng closed 11 months ago

longquanzheng commented 1 year ago

Similar to timerTaskProcessor, worker task can also be deleted within the transaction on completion.

This would reduce the chance that worker task re-execute which could cause more database requests.

For example, after completion, if workerTaskQueue got closed before committing/deleting the worker tasks, the same task will be reloaded and executed again.

This will be easier to understand as well -- currently when worker task backoff retry, it will be converted into a timer task(which means the worker task got deleted during processing)