remove generated webring.json on disk when disabling

and actually use the promises array
indiachan-spamvector
Thomas Lynch 2 years ago
parent be2f65c0b9
commit 4cc8f3957b
Signed by: fatchan
GPG Key ID: 112884AA57DF40B1
  1. 3
      models/forms/changeglobalsettings.js

@ -326,7 +326,8 @@ module.exports = async (req, res, next) => {
if (oldSettings.enableWebring === true && newSettings.enableWebring === false) {
//delete webring boards from boardlist when disabling.
await Boards.db.deleteMany({ webring: true });
promises.push(Boards.db.deleteMany({ webring: true }));
promises.push(remove(`${uploadDirectory}/json/webring.json`));
}
//finish the promises in parallel e.g. removing files

Loading…
Cancel
Save