]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Force create_dt to start_dt for games.
authorAnt Zucaro <azucaro@gmail.com>
Wed, 27 Jan 2016 01:16:57 +0000 (20:16 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Wed, 27 Jan 2016 01:16:57 +0000 (20:16 -0500)
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.

xonstat/views/submission.py

index 79ead377436fb1d227026e27d7d977efe8ba8d97..f63fbd28d4063d1be43698026008a9260b930cf5 100644 (file)
@@ -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: