fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix.
[redakcja.git]
/
src
/
sources
/
management
/
commands
/
sources_process.py
diff --git
a/src/sources/management/commands/sources_process.py
b/src/sources/management/commands/sources_process.py
index
8b3efa9
..
7053e5f
100644
(file)
--- a/
src/sources/management/commands/sources_process.py
+++ b/
src/sources/management/commands/sources_process.py
@@
-1,12
+1,14
@@
+from datetime import timedelta
from django.core.management.base import BaseCommand
from django.db.models import F
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):
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:
).exclude(processed_at__gt=F('modified_at')).order_by('modified_at'):
print(s)
try: