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

Store canonical recurring tasks in the DB #272

Merged
merged 11 commits into from
Aug 7, 2024
Merged

Conversation

rosa
Copy link
Member

@rosa rosa commented Aug 5, 2024

This is a pre-requisite to add support for dynamic recurring tasks in the future and to allow for the execution of a task on-demand, for example, from Mission Control.

@rosa rosa force-pushed the persist-recurring-tasks branch 4 times, most recently from 194a738 to 6b1f62e Compare August 6, 2024 11:27
rosa added 9 commits August 6, 2024 13:34
So we can persist them in the DB and support dynamic tasks, more complex
serialized arguments and enqueuing them on-demand from Mission Control
more easily.
That uses Active Job's arguments serializer/deserializer.
So we can differentiate dynamic ones to not delete them.
And delete them when the schedule is unloaded.
PostgreSQL fails and aborts the current transaction when it hits
a duplicate key conflict during two concurrent INSERTs for the same
value of an unique index. We need to explicitly indicate unique_by
to ignore duplicate rows by this value when inserting
Very similar to inserting recurring tasks on boot.

PostgreSQL fails and aborts the current transaction when it hits
a duplicate key conflict during two concurrent INSERTs for the same
value of an unique index. We need to use `insert` instead of `create`
here and indicate unique_by to ignore duplicate rows by this value
when inserting
@rosa rosa force-pushed the persist-recurring-tasks branch 2 times, most recently from d9890bc to dfa51d1 Compare August 6, 2024 12:12
@rosa rosa force-pushed the persist-recurring-tasks branch from dfa51d1 to c2ec696 Compare August 6, 2024 12:45
rosa added a commit to rails/mission_control-jobs that referenced this pull request Aug 6, 2024
@rosa rosa merged commit eebdd77 into main Aug 7, 2024
8 checks passed
@rosa rosa deleted the persist-recurring-tasks branch August 7, 2024 13:39
rosa added a commit to rails/mission_control-jobs that referenced this pull request Aug 14, 2024
rosa added a commit to rails/mission_control-jobs that referenced this pull request Aug 14, 2024
rosa added a commit to rails/mission_control-jobs that referenced this pull request Aug 14, 2024
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.

1 participant