<commit_before>'use strict';


const db = module.parent.require('./database');
const batch = module.parent.require('./batch');
module.exports = {
	name: 'Delete mentions:sent:<pid> sorted sets',
	timestamp: Date.UTC(2021, 10, 2),
	method: async function () {
        const nextPid = await db.getObjectField('global', 'nextPid');
        const allPids = [];
        for (let pid = 1; pid < nextPid; ++ pid) {
            allPids.push(pid);
        }
        await batch.processArray(allPids, async (pids) => {
            await db.deleteAll(pids.map(pid => `mentions:sent:${pid}`));
        }, {
            batch: 500,<commit_msg>feat: add progress to upgrade script<commit_after>'use strict';


const db = module.parent.require('./database');
const batch = module.parent.require('./batch');
module.exports = {
	name: 'Delete mentions:sent:<pid> sorted sets',
	timestamp: Date.UTC(2021, 10, 2),
	method: async function () {
        const { progress } = this;
        const nextPid = await db.getObjectField('global', 'nextPid');
        const allPids = [];
        for (let pid = 1; pid < nextPid; ++ pid) {
            allPids.push(pid);
        }
        await batch.processArray(allPids, async (pids) => {
            progress.incr(pids.length);
            await db.deleteAll(pids.map(pid => `mentions:sent:${pid}`));
        }, {
            batch: 500,
{'fraction_non_alphanumeric': 0.16200294550810015, 'fraction_numerical': 0.016200294550810016, 'mean_word_length': 2.682926829268293, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3622572', 'n_tokens_mistral': 442, 'n_tokens_neox': 425, 'n_words': 98}