Skip to content

New cronjobMgr service#53

Merged
tiennou merged 3 commits into
ScreepsMods:masterfrom
tiennou:feat/cronjobMgr
May 13, 2026
Merged

New cronjobMgr service#53
tiennou merged 3 commits into
ScreepsMods:masterfrom
tiennou:feat/cronjobMgr

Conversation

@tiennou

@tiennou tiennou commented May 7, 2026

Copy link
Copy Markdown
Member

This adds a new service, adding a cronjobMgr section to the config file whose keys are cronjob names and values are either true, false or a number, overriding the cronjob's default state.

The idea is that if you don't want strongholds, or deposits, just set genStrongholds: false, getDeposits: false which would stop the server from processing those jobs. There's also a new system.listCronjobs() cli command to check on the state of everything.

Included is a small fix to the way we do config block comparisons, as the previous system would just have triggered the event every time because of the equality check used. Instead, do a deep comparison so we only update configs if there are different.

@tiennou

tiennou commented May 7, 2026

Copy link
Copy Markdown
Member Author

Most of that was written with LLM help, though I did a lot of fixing things up because it's never quite right 😅.

tiennou added 2 commits May 9, 2026 01:57
This allows overriding some cronjobs to stop them from running. Also
adds a `system.listCronjobs()` command to show the runtime state.
The genStrongholds is a good example; if it ever rejects, it takes out
the entire backend process because of an uncaught rejection.
@tiennou tiennou force-pushed the feat/cronjobMgr branch from c6de917 to 4836c5c Compare May 9, 2026 00:00
@tiennou

tiennou commented May 9, 2026

Copy link
Copy Markdown
Member Author

Fixed a couple issues with restarts not having the config read yet, leading to disabled cronjobs having a chance at running.

@tiennou tiennou merged commit ae813ad into ScreepsMods:master May 13, 2026
1 check passed
@tiennou tiennou deleted the feat/cronjobMgr branch May 13, 2026 12:00
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

Successfully merging this pull request may close these issues.

2 participants