summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndré Glüpker <git@wgmd.de>2018-05-01 14:16:21 +0200
committerAndré Glüpker <git@wgmd.de>2018-05-01 14:16:21 +0200
commitee6fe5419d2cb87301236023ddf10ea2f0503c83 (patch)
tree1c312845489b1c3fdfe11d3eb4b67cbd6637c935
parent589fba63c8d79ffe95d1155601f451b7ffa09bee (diff)
downloadsteam-ee6fe5419d2cb87301236023ddf10ea2f0503c83.tar.gz
steam-ee6fe5419d2cb87301236023ddf10ea2f0503c83.tar.bz2
steam-ee6fe5419d2cb87301236023ddf10ea2f0503c83.zip
Handle update check in case of server timeouts
-rwxr-xr-xmain.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/main.py b/main.py
index 1fef7cc..187ceec 100755
--- a/main.py
+++ b/main.py
@@ -188,15 +188,17 @@ def server():
for _, serverdata in servers.items():
name = "{0}{1:d}{2:d}".format(serverdata['ip'], serverdata['port'], serverdata['gameid'])
serverdata['data'] = serverdata_[name].result()
- serverdata_['u' + name] = executor.submit(
- steam.getGameUpdateState,
- serverdata['data']['gameid'],
- serverdata['data']['gameversion']
- )
+ if serverdata['data']:
+ serverdata_['u' + name] = executor.submit(
+ steam.getGameUpdateState,
+ serverdata['data']['gameid'],
+ serverdata['data']['gameversion'],
+ )
for _, serverdata in servers.items():
name = "{0}{1:d}{2:d}".format(serverdata['ip'], serverdata['port'], serverdata['gameid'])
- serverdata['update'] = serverdata_['u' + name].result()
+ if 'u' + name in serverdata_:
+ serverdata['update'] = serverdata_['u' + name].result()
return render_template('server_html.jinja',
servers=servers,