Question about events sync when moralis server will be off

Imagine situation, when new cloud functions are deployed. It takes approx 20 seconds to fully load and continue working.

Lets say that I have to sync event - “itemCreated”

For that 20 seconds, itemCreated may happen and afterSave functions will not run for those elements in collection after server start.

This problem is also active for hystorical events. For them, after save will not run.

What is workaround for this situation? Is there any advice you can give?

for historical events you’ll have to run a separate job/task/function
for the case when afterSave didn’t work for whatever reasons, you could use a flag somewhere in db for that entry to keep track for what entries it did run and after that you could easily rerun when needed