IC Cron - let's schedule some tasks bois

I believe @nomeata’s analysis is correct, this pattern of self-calls opens new call contexts that will never be closed on each iteration. It’s a very common mistake with self-calls, I made it myself a couple of times :slight_smile:

Self-calls are indeed very fragile and I’d not recommend using them in production.

My colleagues from the Execution team informed me that canister heartbeat feature should now be available on all subnets. I’m not sure if the replica shipped with the latest DFX also supports this feature. You can add something like this to your canister to check:

#[export_name = "canister_heartbeat"]
fn heartbeat() {
  ic_cdk::api::print("Hello from the heartbeat handler!");
}

This is how Governance uses it: ic/canister.rs at e362530172c44679313b1b7fca1e90d8967545d8 · dfinity/ic · GitHub

5 Likes