OGO
Convex Community2y ago
2 replies
OG

synchronizes issue

The issue we are currently facing is that there's a feature in my business that synchronizes the balance, and this script runs every 15 seconds. When I execute it, I need a parameter, the starting block number.

If the script doesn't finish within 15 seconds, in reality, another task is initiated. The effect of this task is actually the same as the previous one, but when recording the amount, the situation of having the same txhash occurs, which essentially wastes the resources of one execution.

I can add a field in the table to judge this, but this also occupies the read and write of the table.

I hope there could be a system-level variable that lets me distinguish whether this task is currently in execution.

Alternatively, is it possible to create a type for the cron? For instance, if it is an exclusive cron, then it does not allow concurrent execution.
Was this page helpful?