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

Move cron jobs to django-q scheduled tasks #1012

Merged
merged 2 commits into from
Aug 21, 2023

Conversation

saadmk11
Copy link
Member

@saadmk11 saadmk11 commented Aug 20, 2023

Reference #961

TODO:

  • Remove References to cron job (we can either do this on this PR or try the new changes out first)

@saadmk11 saadmk11 added the WIP label Aug 20, 2023
@saadmk11 saadmk11 self-assigned this Aug 20, 2023
@saadmk11 saadmk11 mentioned this pull request Aug 20, 2023
@saadmk11 saadmk11 removed the WIP label Aug 20, 2023
@saadmk11 saadmk11 requested a review from jefftriplett August 20, 2023 16:29
@@ -1,5 +1,6 @@
bs4
cloudflare
croniter
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you want to use this for something? (Not seeing it referenced in case it's used in an unobvious place.)

Copy link
Member Author

Choose a reason for hiding this comment

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

This is required by django-q2 to parse cron expressions. https://django-q2.readthedocs.io/en/master/schedules.html#django_q.Schedule.cron

Copy link
Contributor

@jefftriplett jefftriplett left a comment

Choose a reason for hiding this comment

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

Looks good to me. I left the note about croniter in case you were wanting to use that in settings.

@jefftriplett jefftriplett merged commit ff32157 into djangopackages:main Aug 21, 2023
@jefftriplett
Copy link
Contributor

@mashrikt looks great. We can adjust cron in a new PR. I'll hold off on deploying

@saadmk11 saadmk11 deleted the cronjob-to-dj-q branch August 21, 2023 03:33
@saadmk11
Copy link
Member Author

We can adjust cron in a new PR.

Do you mean the cron schedule?


How do we setup cron jobs on the current production servers? I don't see any references to it on the codebase other than this:

djangopackages/fabfile.py

Lines 127 to 131 in 024ece9

def cron():
with env.cd(env.project_dir):
docker_compose("run django-a python manage.py import_classifiers")
docker_compose("run django-a python manage.py import_products")
docker_compose("run django-a python manage.py import_releases")

Do we set this up manually on production server by modifying the crontab file?

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