reddit: make the cache timeout configurable

And decrease poll time
This commit is contained in:
moneromooo 2015-02-15 11:17:54 +00:00
parent 3ebd4befc5
commit fd7ca261b2
2 changed files with 4 additions and 2 deletions

View File

@ -57,9 +57,10 @@ network_config = {
'login': 'testbx',
'keyword': '/u/testbx',
'user_agent': tipbot_name,
'update_period': 90,
'update_period': 35,
'load_limit': 100,
'use_unread_api': True,
'cache_timeout': 30,
},
'twitter': {
'login': 'tipperome',

View File

@ -51,8 +51,9 @@ class RedditNetwork(Network):
self.load_limit=cfg['load_limit']
self.keyword=cfg['keyword']
self.use_unread_api=cfg['use_unread_api']
self.cache_timeout=cfg['cache_timeout']
self.reddit=praw.Reddit(user_agent=user_agent)
self.reddit=praw.Reddit(user_agent=user_agent,cache_timeout=self.cache_timeout)
self.reddit.login(self.login,password)
self.items_cache=dict()