Fix.
[redakcja.git] / src / sources / management / commands / sources_process.py
index 8b3efa9..7053e5f 100644 (file)
@@ -1,12 +1,14 @@
+from datetime import timedelta
 from django.core.management.base import BaseCommand
 from django.db.models import F
+from django.utils.timezone import now
 from sources.models import Source
 
 
 class Command(BaseCommand):
     def handle(self, **options):
-        for s in Source.objects.exclude(
-                modified_at=None
+        for s in Source.objects.filter(
+            modified_at__lt=now() - timedelta(seconds=60)
         ).exclude(processed_at__gt=F('modified_at')).order_by('modified_at'):
             print(s)
             try: