mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: one more fix
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
/* eslint-disable no-await-in-loop */
|
||||
|
||||
'use strict';
|
||||
|
||||
const crypto = require('crypto');
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
'use strict';
|
||||
|
||||
const crypto = require('crypto');
|
||||
const _ = require('lodash');
|
||||
|
||||
const db = require('../../database');
|
||||
const batch = require('../../batch');
|
||||
@@ -27,7 +28,7 @@ module.exports = {
|
||||
let uploads = await db.getSortedSetRangeWithScores(key, 0, -1);
|
||||
|
||||
// Don't process those that have already the right format
|
||||
uploads = uploads.filter(upload => !upload.value.startsWith('files/'));
|
||||
uploads = _.uniq(uploads.filter(upload => !upload.value.startsWith('files/')));
|
||||
|
||||
// Rename the zset members
|
||||
await db.sortedSetRemove(key, uploads.map(upload => upload.value));
|
||||
|
||||
Reference in New Issue
Block a user