initial commit
This commit is contained in:
0
feeds/management/__init__.py
Normal file
0
feeds/management/__init__.py
Normal file
0
feeds/management/commands/__init__.py
Normal file
0
feeds/management/commands/__init__.py
Normal file
17
feeds/management/commands/worker_loop.py
Normal file
17
feeds/management/commands/worker_loop.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from time import sleep
|
||||
|
||||
from django.core.management import BaseCommand
|
||||
|
||||
from feeds.models import Feed
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
def handle(self, *args, **options):
|
||||
try:
|
||||
while True:
|
||||
feeds = Feed.objects.filter(lock=False)
|
||||
for feed in feeds:
|
||||
feed.run_check()
|
||||
sleep(5)
|
||||
except KeyboardInterrupt:
|
||||
pass
|
Reference in New Issue
Block a user