summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--butler/butler.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/butler/butler.py b/butler/butler.py
index 0405ddc..07d511a 100644
--- a/butler/butler.py
+++ b/butler/butler.py
@@ -15,9 +15,9 @@ queries = config.get('__queries', {})
config = config[butler_set]
-TABL_STEP = 8
-TEAM_STEP = 16
-PLAYER_STEP = 400
+TABL_STEP = int(os.environ.get('LIGA_BUTLER_TABLE_STEP', 8))
+TEAM_STEP = int(os.environ.get('LIGA_BUTLER_TEAM_STEP', 16))
+PLAYER_STEP = int(os.environ.get('LIGA_BUTLER_TEAM_STEP', 500))
tabl_offset = 0
team_offset = 0
@@ -61,9 +61,7 @@ for s_db in config['source']:
print('USE %s;' % (config['output']))
-print('UPDATE admin SET teamcnt=%d, butler=%d;' % (
- 16*len(config['source']), 4*len(config['source'])
-))
+print('UPDATE admin SET teamcnt=(SELECT COUNT(*) FROM teams), butler=(SELECT COUNT(*)/4 FROM teams);')
print('UPDATE teams SET bye=2;')