question: `Timer` Is there any way to know if execution is continuing?
@adamspofford-dfinity is already working on this.
Since Apr 12, 2024.
- Dominant language
- Rust
- Stars
- 230
- Forks
- 103
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 2
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.
https://github.com/dfinity/cdk-rs/issues/392
If this is not the place to inquire, please let us know.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.