Open-source serverless enterprise CMS. Includes a headless CMS, page builder, form builder, and file manager. Easy to customize and expand. Deploys to AWS.
refactor CreateDeleteEntriesTasks class for improved readability and efficiency;
remove redundant variables;
simplify loop conditions;
ensure proper handling of edge cases and pagination;
uniform messages returned by the task execution.
TaskCache and TaskTrigger
The main change introduced by this fix is the use of a cache to store all the subtasks created while looping through the entries that need to be deleted.
Previously, when dealing with a large number of entries, the child tasks would start executing while the main task was still executing. This could cause a race condition and lead to failures when deleting some entries that had already been deleted by other subtasks.
With this pull request, we are now storing inputs for subtasks inside an internal cache and executing them after the main task loop finishes.
Changes
With this PR, we aim to:
TaskCache
andTaskTrigger
The main change introduced by this fix is the use of a cache to store all the subtasks created while looping through the entries that need to be deleted.
Previously, when dealing with a large number of entries, the child tasks would start executing while the main task was still executing. This could cause a race condition and lead to failures when deleting some entries that had already been deleted by other subtasks.
With this pull request, we are now storing inputs for subtasks inside an internal cache and executing them after the main task loop finishes.
How Has This Been Tested?
Manually + Jest