Commits

Alessandro Molina committed 1254ce4

Make article cache configurable

  • Participants
  • Parent commits 3c2a454

Comments (0)

Files changed (1)

smallpress/model/models.py

 
 AttachmentType = tg.config.get('_smallpress',{}).get('attachment_type', AttachedFile)
 ENABLE_ARTICLES_CACHE = tg.config.get('_smallpress',{}).get('enable_cache', False)
+ARTICLE_CACHE_EXPIRE = tg.config.get('_smallpress',{}).get('cache_expire', 30*60)
 
 class Blog(DeclarativeBase):
     __tablename__ = 'smallpress_blogs'
         try:
             return dict(key='%s-%s-%s-%s' % (userid, 'smallpress-article',
                                              self.uid, self.update_date.strftime('%Y-%m-%d-%H-%M-%S')),
-                                             expire=14400, type="memory")
+                                             expire=ARTICLE_CACHE_EXPIRE, type="memory")
         except (IndexError, ValueError):
             return dict()