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

feat: Add command to schedule resource sync task #2161

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

rochacbruno
Copy link
Member

@rochacbruno rochacbruno commented Jun 7, 2024

No-Issue
Related: AAP-23723

What is this PR doing:

$ django-admin task-scheduler --help
usage: django-admin task-scheduler [-h] --id ID --path PATH --interval INTERVAL [--force]
                                   [--version] [-v {0,1,2,3}] [--settings SETTINGS]
                                   [--pythonpath PYTHONPATH] [--traceback] [--no-color]
                                   [--force-color] [--skip-checks]

options:
  -h, --help            show this help message and exit
  --id ID               Unique str identifier for scheduled task e.g: make_sandwich
  --path PATH           Importable path for the callable e.g: galaxy_ng.app.foo.bar
  --interval INTERVAL   Interval in minutes
  --force               Override existing scheduled task with the same identifier

This is the call installers will need to hook on after deployment to enable the task scheduling for resource sync

NOTE: this depends on having RESOURCE_SERVER config in place
ex:
export PULP_RESOURCE_SERVER__URL=https://localhost/
export PULP_RESOURCE_SERVER__SECRET_KEY=hdjkbgdhjsfbhjksdfghjsdfbhjsdfg
export PULP_RESOURCE_SERVER__VALIDATE_HTTPS=false

$ django-admin task-scheduler --id dab_sync --interval 15 --path "galaxy_ng.app.tasks.resource_sync.run"
dab_sync scheduled for every 0:15:00 minutes. next execution on: 2024-06-07 16:21:06.860276+00:00

@github-actions github-actions bot added backport-4.2 This PR should be backported to stable-4.2 (1.2) backport-4.4 This PR should be backported to stable-4.4 (2.1) backport-4.5 This PR should be backported to stable-4.5 (2.2) backport-4.6 This PR should be backported to stable-4.6 (2.3) backport-4.7 This PR should be backported to stable-4.7 (2.4) backport-4.8 This PR should be backported to stable-4.8 (2.4) backport-4.9 This PR should be backported to stable-4.9 (2.4) labels Jun 7, 2024
@rochacbruno rochacbruno removed backport-4.2 This PR should be backported to stable-4.2 (1.2) backport-4.4 This PR should be backported to stable-4.4 (2.1) backport-4.5 This PR should be backported to stable-4.5 (2.2) backport-4.6 This PR should be backported to stable-4.6 (2.3) backport-4.7 This PR should be backported to stable-4.7 (2.4) backport-4.8 This PR should be backported to stable-4.8 (2.4) labels Jun 7, 2024
@rochacbruno rochacbruno removed the backport-4.9 This PR should be backported to stable-4.9 (2.4) label Jun 11, 2024
@rochacbruno rochacbruno merged commit 2ee4279 into ansible:master Jun 11, 2024
26 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants