mirror of https://gitgud.io/fatchan/jschan.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
865 B
26 lines
865 B
'use strict';
|
|
|
|
const config = require(__dirname+'/../lib/misc/config.js')
|
|
, fs = require('fs-extra')
|
|
, uploadDirectory = require(__dirname+'/../lib/file/uploaddirectory.js');
|
|
|
|
module.exports = async(db, redis) => {
|
|
console.log('Adding assets');
|
|
await fs.ensureDir(`${uploadDirectory}/asset/`);
|
|
const template = require(__dirname+'/../configs/template.js.example');
|
|
await db.collection('globalsettings').updateOne({ _id: 'globalsettings' }, {
|
|
'$set': {
|
|
'globalLimits.assetFiles': template.globalLimits.assetFiles,
|
|
'globalLimits.assetFilesSize': template.globalLimits.assetFilesSize,
|
|
},
|
|
});
|
|
await db.collection('boards').updateMany({}, {
|
|
'$set': {
|
|
'assets': [],
|
|
},
|
|
});
|
|
console.log('Cleared boards cache');
|
|
await redis.deletePattern('board:*');
|
|
console.log('Cleared globalsettings cache');
|
|
await redis.deletePattern('globalsettings');
|
|
};
|
|
|