Skip to content

Commit 2543a5b

Browse files
added console logs
1 parent a3d3867 commit 2543a5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

behavior.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,20 @@ function setGameCode(site, code) {
125125
S.onLoad(function () {
126126
S.forEach(["otrio"], function (site) {
127127
M.server.list("^websites/games/" + site + "/game codes/", { maxDepth: 1, hybridCutoff: 3 }).then(function (codes) {
128+
console.log(codes);
128129
let activeGames = [];
129130
let updatedTimes = {};
130131
S.forEach(codes, function (code) {
131132
activeGames.push(M.server.recall("^websites/games/" + site + "/game codes/" + code + "lastUpdated", { hybridCutoff: 3 }).then(function (time) {
133+
console.log(time);
132134
updatedTimes[code] = time;
133135
}));
134136
});
135137
Promise.all(activeGames).then(function () { // once all the last updated times have been retrieved
138+
console.log("retrieved all times");
136139
let now = new Date().getTime();
137140
S.forEach(updatedTimes, function (time, code) {
141+
console.log(now - time);
138142
if (now - time > 172800000) { // if the game hasn't been played in the last 48 hours
139143
M.server.forget("^websites/games/" + site + "/game codes/" + code, { hybridCutoff: 3 });
140144
}

0 commit comments

Comments
 (0)