def queue_new_feeds(self): new_feeds = UserSubscription.objects.filter(user=self.user, feed__fetched_once=False).values("feed_id") new_feeds = list(set([f["feed_id"] for f in new_feeds])) logging.info(" ---> [%s] Queueing NewFeeds: (%s) %s" % (self.user, len(new_feeds), new_feeds)) size = 4 publisher = Task.get_publisher(exchange="new_feeds") for t in (new_feeds[pos : pos + size] for pos in xrange(0, len(new_feeds), size)): NewFeeds.apply_async(args=(t,), queue="new_feeds", publisher=publisher) publisher.connection.close()
def queue_new_feeds(self, new_feeds=None): if not new_feeds: new_feeds = UserSubscription.objects.filter(user=self.user, feed__fetched_once=False, active=True).values('feed_id') new_feeds = list(set([f['feed_id'] for f in new_feeds])) logging.user(self.user, "~BB~FW~SBQueueing NewFeeds: ~FC(%s) %s" % (len(new_feeds), new_feeds)) size = 4 for t in (new_feeds[pos:pos + size] for pos in xrange(0, len(new_feeds), size)): NewFeeds.apply_async(args=(t,), queue="new_feeds")
def queue_new_feeds(self, new_feeds=None): if not new_feeds: new_feeds = UserSubscription.objects.filter(user=self.user, feed__fetched_once=False, active=True).values( "feed_id" ) new_feeds = list(set([f["feed_id"] for f in new_feeds])) logging.user(self.user, "~BB~FW~SBQueueing NewFeeds: ~FC(%s) %s" % (len(new_feeds), new_feeds)) size = 4 publisher = Task.get_publisher(exchange="new_feeds") for t in (new_feeds[pos : pos + size] for pos in xrange(0, len(new_feeds), size)): NewFeeds.apply_async(args=(t,), queue="new_feeds", publisher=publisher) publisher.connection.close()
def queue_new_feeds(self, new_feeds=None): if not new_feeds: new_feeds = UserSubscription.objects.filter( user=self.user, feed__fetched_once=False, active=True).values('feed_id') new_feeds = list(set([f['feed_id'] for f in new_feeds])) logging.info(" ---> [%s] ~BB~FW~SBQueueing NewFeeds: ~FC(%s) %s" % (self.user, len(new_feeds), new_feeds)) size = 4 publisher = Task.get_publisher(exchange="new_feeds") for t in (new_feeds[pos:pos + size] for pos in xrange(0, len(new_feeds), size)): NewFeeds.apply_async(args=(t, ), queue="new_feeds", publisher=publisher) publisher.connection.close()