fix: non-functional upgrade script

isekai-main
Julian Lam 3 years ago
parent b8362c49cd
commit 1c7fb8fe11

@ -10,11 +10,11 @@ module.exports = {
method: async function () { method: async function () {
const { progress } = this; const { progress } = this;
await batch.processSortedSet('posts:pid', async (postData) => { await batch.processSortedSet('posts:pid', async (pids) => {
const keys = postData.map(p => `post:${p.pid}:uploads`); const keys = pids.map(p => `post:${p}:uploads`);
const uploads = await db.getSortedSetRange(keys, 0, -1); const uploads = await db.getSortedSetRange(keys, 0, -1);
await posts.uploads.saveSize(uploads); await posts.uploads.saveSize(uploads);
progress.incr(postData.length); progress.incr(pids.length);
}, { }, {
batch: 100, batch: 100,
progress: progress, progress: progress,

Loading…
Cancel
Save