diff options
author | André Glüpker <git@wgmd.de> | 2018-05-01 14:16:21 +0200 |
---|---|---|
committer | André Glüpker <git@wgmd.de> | 2018-05-01 14:16:21 +0200 |
commit | ee6fe5419d2cb87301236023ddf10ea2f0503c83 (patch) | |
tree | 1c312845489b1c3fdfe11d3eb4b67cbd6637c935 | |
parent | 589fba63c8d79ffe95d1155601f451b7ffa09bee (diff) | |
download | steam-ee6fe5419d2cb87301236023ddf10ea2f0503c83.tar.gz steam-ee6fe5419d2cb87301236023ddf10ea2f0503c83.tar.bz2 steam-ee6fe5419d2cb87301236023ddf10ea2f0503c83.zip |
Handle update check in case of server timeouts
-rwxr-xr-x | main.py | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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, |