time sync

This commit is contained in:
Ayushya Amitabh
2020-05-03 16:02:04 -04:00
parent 2e6d943b9e
commit 8aef416eda
6 changed files with 100 additions and 108 deletions
+2 -3
View File
@@ -461,10 +461,9 @@ exports.scheduledCleanUp = functions.pubsub.schedule('every 60 minutes').onRun(a
roomRef
.get()
.then(async (roomSnap) => {
const roomData = roomSnap.data();
if (
timeDiff(roomData.createdAt, startedTime) >= 24 ||
timeDiff(roomData.updatedAt, startedTime) >= 12
timeDiff(roomSnap.createTime.toDate(), startedTime) >= 24 ||
timeDiff(roomSnap.updateTime.toDate(), startedTime) >= 12
)
await cleanUpRoom(roomSnap.id);
console.info(`Deleted room ${roomSnap.id} from auto cleanup`);