I am seeking advice on how to prevent scheduled tasks from being interrupted. Currently, I have a 512MB memory limit, 4 processes, and only the first process runs the scheduled task using node-schedule. The issue is that it's unstable, with occasional interruptions, such as when a task is running at 2:00 AM 0:00 and the memory is exhausted, causing the task to restart. The scheduled task is aggregating data. My idea is to insert a record into the database when the task starts, and if the status has not changed, the task will continue running after a restart. However, I worry that the database insertion may be interrupted, resulting in the task not continuing to run. For the time being, I do not intend to set a larger memory limit, as the server has 4GB of memory, with Docker running on top.