X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=server%2Fmodels%2FGame.js;h=bc4ebdcaed751eb175fe66ca7789bad6606abc3c;hb=f21cd6d9c23da37d729f20ea4c08e56b1a7b10a1;hp=3d2184b8ab97586c5623ea1dff6c034c833219af;hpb=d431028c73d41a22636130bd6aff562762eaf2bb;p=vchess.git diff --git a/server/models/Game.js b/server/models/Game.js index 3d2184b8..bc4ebdca 100644 --- a/server/models/Game.js +++ b/server/models/Game.js @@ -8,6 +8,7 @@ var db = require("../utils/database"); * fen: varchar (current position) * timeControl: string * score: varchar (result) + * created: datetime * * Structure table Players: * gid: ref game id @@ -191,7 +192,7 @@ const GameModel = "SELECT max(played) AS lastMaj " + "FROM Moves " + "WHERE gid = " + g.id; - db.get(query, (err2,updated) { + db.get(query, (err2,updated) => { if (!updated && tsNow - g.created > 7*day) return GameModel.remove(g.id); const lastMaj = updated.lastMaj;