This commit is contained in:
parent
8892a97435
commit
bda1eba253
|
@ -18,6 +18,7 @@ spooler-python-import = passerelle.utils.spooler
|
|||
spooler-max-tasks = 20
|
||||
|
||||
# every five minutes
|
||||
unique-cron = -5 -1 -1 -1 -1 /usr/bin/passerelle-manage tenant_command cron --all-tenants every5min
|
||||
unique-cron = -5 -1 -1 -1 -1 /usr/bin/passerelle-manage tenant_command cron --all-tenants availability
|
||||
unique-cron = -5 -1 -1 -1 -1 /usr/bin/passerelle-manage tenant_command cron --all-tenants jobs
|
||||
# hourly
|
||||
|
|
|
@ -28,7 +28,10 @@ class Command(BaseCommand):
|
|||
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
'frequency', metavar='FREQUENCY', type=str, help='hourly/daily/weekly/monthly/availability/jobs'
|
||||
'frequency',
|
||||
metavar='FREQUENCY',
|
||||
type=str,
|
||||
help='every5min/hourly/daily/weekly/monthly/availability/jobs',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--connector',
|
||||
|
@ -46,7 +49,7 @@ class Command(BaseCommand):
|
|||
)
|
||||
|
||||
def handle(self, frequency, **options):
|
||||
if frequency not in ('hourly', 'daily', 'weekly', 'monthly', 'availability', 'jobs'):
|
||||
if frequency not in ('every5min', 'hourly', 'daily', 'weekly', 'monthly', 'availability', 'jobs'):
|
||||
raise CommandError('unknown frequency')
|
||||
errors = []
|
||||
for app in get_all_apps():
|
||||
|
|
|
@ -588,6 +588,9 @@ class BaseResource(models.Model):
|
|||
else:
|
||||
ResourceStatus.objects.filter(pk=current_status.pk).update(message=message)
|
||||
|
||||
def every5min(self):
|
||||
pass
|
||||
|
||||
def hourly(self):
|
||||
pass
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ from passerelle.apps.base_adresse.models import BaseAdresse
|
|||
|
||||
|
||||
def test_cron_frequencies(db):
|
||||
for frequency in ('hourly', 'daily', 'weekly', 'monthly'):
|
||||
for frequency in ('every5min', 'hourly', 'daily', 'weekly', 'monthly'):
|
||||
call_command('cron', frequency)
|
||||
with pytest.raises(CommandError):
|
||||
call_command('cron', 'randomly')
|
||||
|
|
Loading…
Reference in New Issue