mirror of
https://github.com/quantum5/qlinks.git
synced 2025-04-24 10:41:57 -04:00
Handle the case with no links in check command
This commit is contained in:
parent
ff74e1c502
commit
3dfc0a3682
|
@ -36,7 +36,7 @@ class Command(BaseCommand):
|
||||||
self.check_links()
|
self.check_links()
|
||||||
|
|
||||||
next_check = Link.objects.aggregate(min=Min('next_check'))['min']
|
next_check = Link.objects.aggregate(min=Min('next_check'))['min']
|
||||||
wait = (next_check - timezone.now()).total_seconds()
|
wait = (next_check - timezone.now() if next_check else settings.QLINKS_CHECK_MIN).total_seconds()
|
||||||
if wait > 0:
|
if wait > 0:
|
||||||
if self.verbosity > 2:
|
if self.verbosity > 2:
|
||||||
self.stdout.write(f'Sleeping for: {wait:.0f} seconds')
|
self.stdout.write(f'Sleeping for: {wait:.0f} seconds')
|
||||||
|
|
Loading…
Reference in a new issue