From: Ant Zucaro Date: Wed, 27 Jan 2016 01:16:57 +0000 (-0500) Subject: Force create_dt to start_dt for games. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=594417dc3d2a9aebf99ffbe510adfa80ae7dbc1d;p=xonotic%2Fxonstat.git Force create_dt to start_dt for games. There's some drift in the database between the two, when in actuality they should only be milliseconds apart. The start_dt *was* being set via the application and the create_dt with a database default. The values resulting from the defaults were sometimes minutes earlier, which doesn't makes sense. Until the true cause is identified I'll force the two to be the same. --- diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 79ead37..f63fbd2 100644 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -487,6 +487,11 @@ def create_game(session, start_dt, game_type_cd, server_id, map_id, game.match_id = match_id game.mod = mod[:64] + # There is some drift between start_dt (provided by app) and create_dt + # (default in the database), so we'll make them the same until this is + # resolved. + game.create_dt = start_dt + try: game.duration = datetime.timedelta(seconds=int(round(float(duration)))) except: