Fix incorrect arg to Modlogs.deleteOld not pruning modlogs when updating modloglist. (the public page was still "correct" since it filtered the dates beforehand)

merge-requests/341/head
Thomas Lynch 2 years ago
parent 23d32abd96
commit 1e70a5aa62
  1. 2
      db/modlogs.js
  2. 4
      lib/build/tasks.js

@ -11,7 +11,7 @@ module.exports = {
return db.aggregate([
{
'$match': {
'board': board._id
'board': board
}
},
{

@ -207,7 +207,7 @@ module.exports = {
buildModLogList: async (options) => {
const label = `/${options.board._id}/logs.html`;
const start = process.hrtime();
let dates = await Modlogs.getDates(options.board);
let dates = await Modlogs.getDates(options.board._id);
const { pruneModlogs } = config.get;
if (pruneModlogs) {
const pruneLogs = [];
@ -226,7 +226,7 @@ module.exports = {
await Promise.all(pruneLogs.map(log => {
remove(`${uploadDirectory}/html/${options.board._id}/logs/${log}.html`);
}));
await Modlogs.deleteOld(options.board, pruneAfter);
await Modlogs.deleteOld(options.board._id, pruneAfter);
}
}
const { html } = await render(label, 'modloglist.pug', {

Loading…
Cancel
Save