From 08e66664376e89adfaeec6d72a3740b125ac3884 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Fri, 25 Jan 2019 19:33:54 +0300 Subject: [PATCH] fix --- feeds/models.py | 4 ++-- feeds/tasks.py | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/feeds/models.py b/feeds/models.py index 1082836..0c1092d 100644 --- a/feeds/models.py +++ b/feeds/models.py @@ -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: diff --git a/feeds/tasks.py b/feeds/tasks.py index 0991e8a..88d92a2 100644 --- a/feeds/tasks.py +++ b/feeds/tasks.py @@ -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)