recalculating only the new hanchans shoud do the trick now.

the racalc cronjob reports erronous partly recalculations now.
A lot of code cleanups
This commit is contained in:
2017-11-01 09:53:52 +01:00
parent ec8761b868
commit f3d44b743b
15 changed files with 87 additions and 62 deletions

View File

@@ -2,7 +2,7 @@
from django.core.cache import cache
from mahjong_ranking import models
from . import logger, MIN_HANCHANS_FOR_LADDER
from . import LOGGER, MIN_HANCHANS_FOR_LADDER
class DenormalizationUpdateMiddleware(object): # Ignore PyLintBear (R0903)
@@ -57,7 +57,7 @@ class DenormalizationUpdateMiddleware(object): # Ignore PyLintBear (R0903)
ranking.save(force_update=True)
for season in season_queue:
logger.info(u'Recalculate placements for Season %d', season)
LOGGER.info(u'Recalculate placements for Season %d', season)
season_rankings = models.SeasonRanking.objects.filter(
season=season, hanchan_count__gt=MIN_HANCHANS_FOR_LADDER
).order_by('avg_placement', '-avg_score')