diff options
author | emkael <emkael@tlen.pl> | 2021-11-20 15:22:20 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2021-11-20 15:22:20 +0100 |
commit | aa205ae2a38529599aa726fd7881a3c33d9db109 (patch) | |
tree | 1a695e84ca7d6e1699fd7cb965aedad78fdfb8db /butler | |
parent | 184310dea9f3b6d22786dd42776ff6e7093c58e9 (diff) |
Flexible butler compilation with abnormal group sizes
Diffstat (limited to 'butler')
-rw-r--r-- | butler/butler.py | 10 |
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;') |