Closed orassayag closed 6 years ago
You don't want to drop the whole collection at the end of each individual task because other tasks could still be running elsewhere in the app.
Currently, when a task is done, it gets deleted from the collection; if all your tasks are successful, ojlinttaskcollections will be empty and would take up zero memory. However, if a task fails halfway through, and you delete the whole collection, there would be no way to rollback to a stable state . The roller uses the task collection to rollback unfinished tasks.
The only time it's safe to drop the whole collection is when your server is shutting down. Even then, you should check to make sure that the collection is empty before dropping it. The point of having a task collection is to make sure that even if the server crashes, there is a persistent source of truth from which rollbacks can be performed.
TLDR; You shouldn't delete the whole collection at the end of every task, unless you're using the task in only one area of the app and you shouldn't delete the collection when the server shuts down, unless you're sure it's completely empty.
You're right. my bad, didn't think about that.
I needed to drop it manually after each task i preformed. Can you preform an action that drops it each task? Thanks!