mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 09:31:17 +01:00
upload script for #6455, @psychobunny
This commit is contained in:
21
src/upgrades/1.9.0/refresh_post_upload_associations.js
Normal file
21
src/upgrades/1.9.0/refresh_post_upload_associations.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
var async = require('async');
|
||||
var posts = require('../../posts');
|
||||
|
||||
module.exports = {
|
||||
name: 'Refresh post-upload associations',
|
||||
timestamp: Date.UTC(2018, 3, 16),
|
||||
method: function (callback) {
|
||||
var progress = this.progress;
|
||||
|
||||
require('../../batch').processSortedSet('posts:pid', function (pids, next) {
|
||||
async.each(pids, function (pid, next) {
|
||||
posts.uploads.sync(pid, next);
|
||||
progress.incr();
|
||||
}, next);
|
||||
}, {
|
||||
progress: this.progress,
|
||||
}, callback);
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user