From 815b621471899670336c7ec475ad04370b828778 Mon Sep 17 00:00:00 2001 From: Wingy Date: Wed, 15 Sep 2021 02:57:28 -0400 Subject: [PATCH] ensure all pfps on startup --- routes/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/routes/index.js b/routes/index.js index 456faf2..141f495 100644 --- a/routes/index.js +++ b/routes/index.js @@ -18,6 +18,13 @@ module.exports = ({ db, config }) => { await db.put(user) } + ;(async () => { + const { rows } = await db.allDocs({ include_docs: true }) + for (const row of rows) { + await ensurePfp(row.id) + } + })() + const router = express.Router() router.use('/', express.static(path.join(__dirname, '../static')))