summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-12-29 11:57:45 +0100
committerTor Andersson <tor@ccxvii.net>2024-01-01 16:47:38 +0100
commitdf4dd7c1cf457e47615ac687f4e97c1ef24d9b30 (patch)
tree61590cf870ba105c5d1efe0e3a354d529d3e7077
parent346383dad99ad34fcb1c382eb73ee327732fc990 (diff)
downloadserver-df4dd7c1cf457e47615ac687f4e97c1ef24d9b30.tar.gz
Don't archive games that were abandoned early.
-rw-r--r--server.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/server.js b/server.js
index 844513c..9cf75c2 100644
--- a/server.js
+++ b/server.js
@@ -2382,12 +2382,13 @@ const QUERY_PURGE_ACTIVE_GAMES = SQL(`
`)
// don't keep solo games in archive
+// don't keep games abandoned in the first turns
const QUERY_PURGE_FINISHED_GAMES = SQL(`
delete from
games
where
status > 1
- and not is_opposed
+ and ( not is_opposed or moves <= player_count * 3 )
and julianday(mtime) < julianday('now', '-10 days')
`)