-
Notifications
You must be signed in to change notification settings - Fork 104
Description
I want to reliably perform the same task again if the timer execution stops. There is one issue that cannot be resolved.
If the canister is stopped, I don't think I can determine how to restart the timer.
There are two ways to stop the canister: manually by executing stop or when cycles are exhausted.
If manually stopped, timer continues; if cycles are exhausted, timer is stopped.
The global timer is also deactivated upon changes to the canister's Wasm module (calling install_code, install_chunked_code, uninstall_code methods of the management canister or if the canister runs out of cycles).
https://internetcomputer.org/docs/current/references/ic-interface-spec#global-timer
If it keeps running, TimerId can be saved in heap memory, and in case of upgrade, it is enough to set the timer again (by post_upgrade hook), so there should be no problem except for the above case.
If stable memory is available, TimerId can be stored continuously, so that in any case one timer can always be maintained by stopping past timers and setting a new timer.
If this is not the place to inquire, please let us know.