diff --git a/.github/workflows/clean-db.yml b/.github/workflows/clean-db.yml index 98501c1..7062a7b 100644 --- a/.github/workflows/clean-db.yml +++ b/.github/workflows/clean-db.yml @@ -29,4 +29,3 @@ jobs: - name: Clean run: make dev_clean_db - \ No newline at end of file diff --git a/clean-db.js b/clean-db.js index 46323a6..7c08f1c 100644 --- a/clean-db.js +++ b/clean-db.js @@ -21,13 +21,13 @@ const main = async function() { if (typeof updatedAt !== 'number') { process.stdout.write(`room#${childSnapshot.key}\twrong type: ${typeof updatedAt}\n`); } else if (updatedAt < now - diff) { - process.stdout.write(`room#${childSnapshot.key}\tupdated ${Math.round((now - updatedAt) / 60 / 60 / 24)} hours ago\n`); + process.stdout.write(`room#${childSnapshot.key}\tupdated ${Math.round((now - updatedAt) / 60 / 60 / 24)} days ago\n`); } else if (updatedAt > now + diff) { - process.stdout.write(`room#${childSnapshot.key}\tupdated ${Math.round((updatedAt - now) / 60 / 60 / 24)} hours ahead (in future)\n`); + process.stdout.write(`room#${childSnapshot.key}\tupdated ${Math.round((updatedAt - now) / 60 / 60 / 24)} days ahead (in future)\n`); } else { return; } - await childSnapshot.ref.remove(); + // await childSnapshot.ref.remove(); ++count; })(); promises.push(task); diff --git a/stats.js b/stats.js index 2b616be..f3d9977 100644 --- a/stats.js +++ b/stats.js @@ -1,5 +1,5 @@ import admin from 'firebase-admin'; -import { ref, onValue, get } from 'firebase/database'; +import { get } from 'firebase/database'; import serviceAccount from './service-account-key.json' assert { type: "json" }; admin.initializeApp({