mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-21 04:26:36 +00:00
Merge pull request #765 from tcely/patch-3
Upgrade to 1.2.8 for Django 5 support
This commit is contained in:
commit
a57b92b5b1
2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@ -15,7 +15,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
|
||||
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Python ${{ matrix.python-version }}
|
||||
|
4
Pipfile
4
Pipfile
@ -7,7 +7,7 @@ verify_ssl = true
|
||||
autopep8 = "*"
|
||||
|
||||
[packages]
|
||||
django = "~=3.2"
|
||||
django = "*"
|
||||
django-sass-processor = "*"
|
||||
libsass = "*"
|
||||
pillow = "*"
|
||||
@ -15,7 +15,7 @@ whitenoise = "*"
|
||||
gunicorn = "*"
|
||||
django-compressor = "*"
|
||||
httptools = "*"
|
||||
django-background-tasks = "==1.2.5"
|
||||
django-background-tasks = ">=1.2.8"
|
||||
django-basicauth = "*"
|
||||
psycopg2-binary = "*"
|
||||
mysqlclient = "*"
|
||||
|
@ -6,8 +6,8 @@ import logging
|
||||
import os
|
||||
import traceback
|
||||
|
||||
from compat import StringIO
|
||||
from compat.models import GenericForeignKey
|
||||
from io import StringIO
|
||||
from django.contrib.contenttypes.fields import GenericForeignKey
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.db import models
|
||||
from django.db.models import Q
|
||||
@ -50,7 +50,8 @@ class TaskManager(models.Manager):
|
||||
if queue:
|
||||
qs = qs.filter(queue=queue)
|
||||
ready = qs.filter(run_at__lte=now, failed_at=None)
|
||||
_priority_ordering = '{}priority'.format(app_settings.BACKGROUND_TASK_PRIORITY_ORDERING)
|
||||
_priority_ordering = '{}priority'.format(
|
||||
app_settings.BACKGROUND_TASK_PRIORITY_ORDERING)
|
||||
ready = ready.order_by(_priority_ordering, 'run_at')
|
||||
|
||||
if app_settings.BACKGROUND_TASK_RUN_ASYNC:
|
||||
@ -102,7 +103,8 @@ class TaskManager(models.Manager):
|
||||
s = "%s%s" % (task_name, task_params)
|
||||
task_hash = sha1(s.encode('utf-8')).hexdigest()
|
||||
if remove_existing_tasks:
|
||||
Task.objects.filter(task_hash=task_hash, locked_at__isnull=True).delete()
|
||||
Task.objects.filter(task_hash=task_hash,
|
||||
locked_at__isnull=True).delete()
|
||||
return Task(task_name=task_name,
|
||||
task_params=task_params,
|
||||
task_hash=task_hash,
|
||||
@ -251,7 +253,8 @@ class Task(models.Model):
|
||||
self.failed_at = timezone.now()
|
||||
logger.warning('Marking task %s as failed', self)
|
||||
completed = self.create_completed_task()
|
||||
task_failed.send(sender=self.__class__, task_id=self.id, completed_task=completed)
|
||||
task_failed.send(sender=self.__class__,
|
||||
task_id=self.id, completed_task=completed)
|
||||
self.delete()
|
||||
else:
|
||||
backoff = timedelta(seconds=(self.attempts ** 4) + 5)
|
||||
@ -330,9 +333,6 @@ class Task(models.Model):
|
||||
db_table = 'background_task'
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class CompletedTaskQuerySet(models.QuerySet):
|
||||
|
||||
def created_by(self, creator):
|
||||
@ -389,7 +389,8 @@ class CompletedTask(models.Model):
|
||||
# when the task should be run
|
||||
run_at = models.DateTimeField(db_index=True)
|
||||
|
||||
repeat = models.BigIntegerField(choices=Task.REPEAT_CHOICES, default=Task.NEVER)
|
||||
repeat = models.BigIntegerField(
|
||||
choices=Task.REPEAT_CHOICES, default=Task.NEVER)
|
||||
repeat_until = models.DateTimeField(null=True, blank=True)
|
||||
|
||||
# the "name" of the queue this is to be run on
|
||||
|
Loading…
Reference in New Issue
Block a user