Allow forcing refresh of the tipbot balance

This commit is contained in:
moneromooo 2015-01-25 21:35:34 +00:00
parent 0ab24f9e86
commit 9f5992c1ea
2 changed files with 4 additions and 4 deletions

View file

@ -264,8 +264,8 @@ def ResetGameStats(link,sidentity,game):
log_error('Error resetting %s stats for %s: %s' % (game,sidentity,str(e)))
raise
def RetrieveHouseBalance():
balance, unlocked_balance = RetrieveTipbotBalance()
def RetrieveHouseBalance(force_refresh=False):
balance, unlocked_balance = RetrieveTipbotBalance(force_refresh)
house_balance = unlocked_balance
user_balances=0

View file

@ -188,9 +188,9 @@ def SendDaemonJSONRPCCommand(method,params):
def SendDaemonHTMLCommand(method):
return SendHTMLCommand(config.daemon_host,config.daemon_port,method)
def RetrieveTipbotBalance():
def RetrieveTipbotBalance(force_refresh=False):
global cached_tipbot_balance, cached_tipbot_unlocked_balance, cached_tipbot_balance_timestamp
if cached_tipbot_balance_timestamp and time.time()-cached_tipbot_balance_timestamp < config.tipbot_balance_cache_time:
if not force_refresh and cached_tipbot_balance_timestamp and time.time()-cached_tipbot_balance_timestamp < config.tipbot_balance_cache_time:
return cached_tipbot_balance, cached_tipbot_unlocked_balance
j = SendWalletJSONRPCCommand("getbalance",None)