This commit is contained in:
bakatrouble 2019-01-25 19:33:54 +03:00
parent 90d8c02a08
commit 08e6666437
2 changed files with 3 additions and 7 deletions

View File

@ -28,8 +28,8 @@ class Feed(models.Model):
if self.last_check and timezone.now() < self.last_check + self.check_interval:
return
# self.lock = True
# self.save()
self.lock = True
self.save()
execute_feed.delay(self.pk)
class Meta:

View File

@ -11,12 +11,8 @@ from config.celery import app
@app.task()
def execute_feed(feed_pk):
from feeds.models import Feed
from django.db import connections
c = connections['default'].cursor()
print(c.db.__dict__)
# config._reload_maybe()
config._reload_maybe()
try:
feed = Feed.objects.get(pk=feed_pk)