My use case requires me to update 1000 objects from an external source into one of my tables daily.
I am struggling to find an elegant way to do this.
- Set a timer to repeat every day, set a counter to 1000.
- Set a second timer to repeat every minute. In the second timer, logic sets the counter to decrement from 1000 by 1 and triggers an API method that does the updating
- Set a before event handler that blocks the api method when the counter reaches zero
This is not a very elegant method. Is there a better way to update 1000 objects daily, without allowing execution timeouts but remembering where I left off and stopping further code running until the next day?