From aa205ae2a38529599aa726fd7881a3c33d9db109 Mon Sep 17 00:00:00 2001 From: emkael Date: Sat, 20 Nov 2021 15:22:20 +0100 Subject: Flexible butler compilation with abnormal group sizes --- butler/butler.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'butler') 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;') -- cgit v1.2.3