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

Add domain and task argument support to TaskSchedule. #5779

Closed

Conversation

decko
Copy link
Member

@decko decko commented Sep 9, 2024

Closes #5778

@decko decko force-pushed the add_domain_and_args_support_task_schedule branch from 357e61e to 5b7a5dd Compare September 9, 2024 16:36
@@ -8,7 +8,7 @@
Pulp supports scheduling of tasks. Scheduled tasks will be dispatched shortly after their
`next_dispatch` time, and be rescheduled one `dispatch_interval` after that, if the latter is
set. By specifying the `dispatch_interval` as `time_delta(days=1)` you can expect the task
dispatch to stabily happen at same time every day. Until the last task of the same schedule enters a
dispatch to stably happen at same time every day. Until the last task of the same schedule enters a
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
dispatch to stably happen at same time every day. Until the last task of the same schedule enters a
dispatch to stably happen at the same time every day. Until the last task of the same schedule enters a

@@ -371,6 +372,8 @@ class TaskSchedule(BaseModel):
dispatch_interval = models.DurationField(null=True)
task_name = models.TextField()
last_task = models.ForeignKey(Task, null=True, on_delete=models.SET_NULL)
pulp_domain = models.ForeignKey(Domain, null=True, on_delete=models.CASCADE)
task_args = models.TextField(null=True)
Copy link
Member

Choose a reason for hiding this comment

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

Should we use here JSONField instead: https://docs.djangoproject.com/en/4.2/ref/models/fields/#jsonfield? It appears to be much more safe than calling ast.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great idea. Gonna work on that.

@decko decko closed this Oct 1, 2024
@decko decko deleted the add_domain_and_args_support_task_schedule branch October 1, 2024 14:40
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.

Add support for arguments to a TaskSchedule instance
2 participants