-
Notifications
You must be signed in to change notification settings - Fork 0
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 Django 4 compatibility #2
Add Django 4 compatibility #2
Conversation
fired at the same time - which may happened when job execution is longer that job interval. | ||
""" | ||
|
||
@transaction.atomic | ||
def lock(self): | ||
lock, created = CronJobLock.objects.get_or_create(job_name=self.job_name) | ||
lock, created = CronJobLock.objects.select_for_update().get_or_create(job_name=self.job_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably isn't needed for us, but good future proofing, resolves an issue listed here
@@ -1,6 +1,6 @@ | |||
from django.conf import settings | |||
|
|||
from django_common.helper import send_mail | |||
from django.core.mail import send_mail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes this issue
@@ -13,7 +13,7 @@ jobs: | |||
strategy: | |||
max-parallel: 4 | |||
matrix: | |||
python-version: [3.8, 3.9, 3.10, 3.11] | |||
python-version: [3.8, 3.9, '3.10', 3.11] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required due to actions/runner#1989
.travis.yml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this file is unused as it uses github/workflows for the test runners.
@@ -5,13 +5,13 @@ | |||
|
|||
class DatabaseLock(DjangoCronJobLock): | |||
""" | |||
Locking cron jobs with database. Its good when you have not parallel run and want to make sure 2 jobs won't be | |||
Locking cron jobs with database. It's good when you have not parallel run and want to make sure 2 jobs won't be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"have not parallel run" doesn't read right? I'm not sure exactly what it means.
Locking cron jobs with database. It's good when you have not parallel run and want to make sure 2 jobs won't be | |
Locking cron jobs with database. It's good when you have not run cron jobs in parallel and want to make sure 2 jobs won't be |
Unlike last time we did this #1 there haven't been many changes made on the base django-cron branch, so there's been nothing to merge in. I've updated the versions and the test matrix to cover django 4 testing, which are all passing.