Permalink
Browse files

Upgrading redis to 2.6.2.

  • Loading branch information...
1 parent e52b64a commit b49526d87b4514b3b4624c99e7e4e2c443ded63b @samuelclay committed Oct 29, 2012
Showing with 233 additions and 132 deletions.
  1. +10 −3 apps/rss_feeds/models.py
  2. +1 −1 config/redis-init
  3. +220 −126 config/redis.conf
  4. +2 −2 fabfile.py
View
@@ -275,7 +275,11 @@ def by_url(address):
@classmethod
def task_feeds(cls, feeds, queue_size=12):
- logging.debug(" ---> Tasking %s feeds..." % feeds.count())
+ if isinstance(feeds, Feed):
+ logging.debug(" ---> Tasking feed: %s" % feeds)
+ feeds = [feeds]
+ else:
+ logging.debug(" ---> Tasking %s feeds..." % len(feeds))
feed_queue = []
for f in feeds:
@@ -1402,13 +1406,16 @@ def remove_from_redis(self, r=None):
def sync_all_redis(cls, story_feed_id=None):
r = redis.Redis(connection_pool=settings.REDIS_STORY_POOL)
DAYS_OF_UNREAD = datetime.datetime.now() - datetime.timedelta(days=settings.DAYS_OF_UNREAD)
+ feed = None
+ if story_feed_id:
+ feed = Feed.get_by_id(story_feed_id)
stories = cls.objects.filter(story_date__gte=DAYS_OF_UNREAD)
if story_feed_id:
stories = stories.filter(story_feed_id=story_feed_id)
r.delete('F:%s' % story_feed_id)
r.delete('zF:%s' % story_feed_id)
-
- print " ---> Syncing %s stories in %s" % (stories.count(), story_feed_id)
+
+ logging.info(" ---> [%-30s] ~FMSyncing ~SB%s~SN stories to redis" % (feed and feed.title[:30] or story_feed_id, stories.count()))
for story in stories:
story.sync_redis(r)
View
@@ -7,7 +7,7 @@ REDISPORT=6379
EXEC=/usr/local/bin/redis-server
CLIEXEC=/usr/local/bin/redis-cli
-PIDFILE=/var/log/redis.pid
+PIDFILE=/var/run/redis.pid
CONF="/etc/redis.conf"
case "$1" in
Oops, something went wrong.

0 comments on commit b49526d

Please sign in to comment.