mirror of
https://git.wownero.com/wownero/tippero.git
synced 2024-08-15 00:33:14 +00:00
reddit: make the cache timeout configurable
And decrease poll time
This commit is contained in:
parent
3ebd4befc5
commit
fd7ca261b2
2 changed files with 4 additions and 2 deletions
|
@ -57,9 +57,10 @@ network_config = {
|
||||||
'login': 'testbx',
|
'login': 'testbx',
|
||||||
'keyword': '/u/testbx',
|
'keyword': '/u/testbx',
|
||||||
'user_agent': tipbot_name,
|
'user_agent': tipbot_name,
|
||||||
'update_period': 90,
|
'update_period': 35,
|
||||||
'load_limit': 100,
|
'load_limit': 100,
|
||||||
'use_unread_api': True,
|
'use_unread_api': True,
|
||||||
|
'cache_timeout': 30,
|
||||||
},
|
},
|
||||||
'twitter': {
|
'twitter': {
|
||||||
'login': 'tipperome',
|
'login': 'tipperome',
|
||||||
|
|
|
@ -51,8 +51,9 @@ class RedditNetwork(Network):
|
||||||
self.load_limit=cfg['load_limit']
|
self.load_limit=cfg['load_limit']
|
||||||
self.keyword=cfg['keyword']
|
self.keyword=cfg['keyword']
|
||||||
self.use_unread_api=cfg['use_unread_api']
|
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.reddit.login(self.login,password)
|
||||||
self.items_cache=dict()
|
self.items_cache=dict()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue