mirror of
https://github.com/viq/NewsBlur.git
synced 2025-08-05 16:49:45 +00:00
Explicit queue management.
This commit is contained in:
parent
c24a7ffc5f
commit
032505591d
2 changed files with 13 additions and 3 deletions
|
@ -40,9 +40,9 @@ class Command(BaseCommand):
|
|||
|
||||
if i == 12:
|
||||
print feed_queue
|
||||
UpdateFeeds.apply_async(args=(feed_queue,))
|
||||
UpdateFeeds.apply_async(args=(feed_queue,), queue='update_feeds')
|
||||
feed_queue = []
|
||||
i = 0
|
||||
if feed_queue:
|
||||
print feed_queue
|
||||
UpdateFeeds.apply_async(args=(feed_queue,))
|
||||
UpdateFeeds.apply_async(args=(feed_queue,), queue='update_feeds')
|
|
@ -14,5 +14,15 @@ class UpdateFeeds(Task):
|
|||
feed = Feed.objects.get(pk=feed_pk)
|
||||
feed.update()
|
||||
|
||||
class NewFeeds(UpdateFeeds):
|
||||
class NewFeeds(Task):
|
||||
name = 'new-feeds'
|
||||
max_retries = 0
|
||||
ignore_result = True
|
||||
|
||||
def run(self, feed_pks, **kwargs):
|
||||
if not isinstance(feed_pks, list):
|
||||
feed_pks = [feed_pks]
|
||||
|
||||
for feed_pk in feed_pks:
|
||||
feed = Feed.objects.get(pk=feed_pk)
|
||||
feed.update()
|
||||
|
|
Loading…
Add table
Reference in a new issue