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

Support periodic jobs #70

Merged
merged 15 commits into from Sep 9, 2022
Merged

Support periodic jobs #70

merged 15 commits into from Sep 9, 2022

Conversation

jysandy
Copy link
Contributor

@jysandy jysandy commented Aug 23, 2022

Closes #52

Copy link
Member

@olttwa olttwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jysandy Overall, the feature looks solid.
API for cron-job management is necessary before this can be merged.
Feature to limit on periodic-jobs can wait

src/goose/brokers/redis/cron/registry.clj Outdated Show resolved Hide resolved
src/goose/brokers/redis/commands.clj Outdated Show resolved Hide resolved
src/goose/brokers/redis/cron/registry.clj Outdated Show resolved Hide resolved
src/goose/brokers/redis/scheduler.clj Outdated Show resolved Hide resolved
src/goose/brokers/redis/scheduler.clj Outdated Show resolved Hide resolved
src/goose/specs.clj Outdated Show resolved Hide resolved
src/goose/client.clj Outdated Show resolved Hide resolved
src/goose/brokers/redis/cron/registry.clj Outdated Show resolved Hide resolved
src/goose/client.clj Show resolved Hide resolved
This is done by wrapping the find and enqueue
in a Carmine atomic block and watching the cron
schedules key. Also adds a macro to wrap code
in a Carmine transaction.
- Fix linter warnings
- Rename and refactor a couple of functions
...to a maximum of 60 seconds. This will ensure
that cron jobs are run on time.
Registering a cron entry with an existing name
will cause the existing entry to be overwritten.
The default pool options in goose.brokers.redis.broker
were failing this spec.
Cron entries are now registered in a hash map,
keyed by their names. Their due times are
maintained in a sorted set of due time epoch millis
against their names.
Now, SCAN results are accessed through a lazy
seq.
This is the latency from the time a cron job was supposed to
be run to the time it was picked up.
@olttwa olttwa merged commit 98aeee0 into main Sep 9, 2022
@olttwa olttwa deleted the periodic-jobs branch September 9, 2022 13:56
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.

[redis] Periodic Jobs Feature
2 participants