This commit is contained in:
2019-03-14 09:53:06 +03:00
parent add2c9597a
commit d5ed758605
2 changed files with 10 additions and 6 deletions
+3 -2
View File
@@ -24,13 +24,14 @@ class Feed(models.Model):
def run_check(self):
if self.lock:
return
return False
if self.last_check and timezone.now() < self.last_check + self.check_interval:
return
return False
self.lock = True
self.save()
execute_feed.apply_async(args=(self.pk,), shadow=str(self))
return True
def __str__(self):
return f'#{self.pk} {self.title}'