1 | 'use strict';
|
2 |
|
3 |
|
4 | const db = module.parent.require('./database');
|
5 | const batch = module.parent.require('./batch');
|
6 | module.exports = {
|
7 | name: 'Delete mentions:sent:<pid> sorted sets',
|
8 | timestamp: Date.UTC(2021, 10, 2),
|
9 | method: async function () {
|
10 | const nextPid = await db.getObjectField('global', 'nextPid');
|
11 | const allPids = [];
|
12 | for (let pid = 1; pid < nextPid; ++ pid) {
|
13 | allPids.push(pid);
|
14 | }
|
15 | await batch.processArray(allPids, async (pids) => {
|
16 | await db.deleteAll(pids.map(pid => `mentions:sent:${pid}`));
|
17 | }, {
|
18 | batch: 500,
|
19 | });
|
20 | },
|
21 | }; |
\ | No newline at end of file |