Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

collect all jobs before starting execution #11

Open
malteish opened this issue Sep 8, 2024 · 0 comments
Open

collect all jobs before starting execution #11

malteish opened this issue Sep 8, 2024 · 0 comments

Comments

@malteish
Copy link
Owner

malteish commented Sep 8, 2024

currently, when starting the canister, it might catch up on jobs, resulting in reverts.
Example: we scan 100 blocks, and job a should be executed every 10 blocks. It was executed in blocks 10, 20, 30, 40, resulting in 4 logs that order new executions. The canister would currently try to execute the job 4 times because it does not check if the execution has taken place. Instead of starting a timer each time, it should keep a list like this:
job -> nextExecutionTime

When scanning the 4 logs, nextExecutionTime is updated 4 times without execution. Only when the current block is reached should we scan for which job to execute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant