0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-06-22 04:58:40 +00:00

remove logs

This commit is contained in:
Víctor Losada Hernández
2026-05-29 11:32:31 +02:00
parent 1838a57e53
commit 55c4504ed9
-2
View File
@@ -77,11 +77,9 @@ export default function createAdminApi(vite) {
// Delete up to 300 brews that have not been viewed or updated in 30 days and are shorter than 140 bytes // Delete up to 300 brews that have not been viewed or updated in 30 days and are shorter than 140 bytes
router.post('/admin/cleanupJunk', mw.adminOnly, (req, res)=>{ router.post('/admin/cleanupJunk', mw.adminOnly, (req, res)=>{
console.log('deleting');
HomebrewModel.aggregate(junkBrewsPipeline).option({ maxTimeMS: 60000 }) HomebrewModel.aggregate(junkBrewsPipeline).option({ maxTimeMS: 60000 })
.then((docs)=>{ .then((docs)=>{
const ids = docs.map((doc)=>doc._id); const ids = docs.map((doc)=>doc._id);
console.log(ids);
return HomebrewModel.deleteMany({ _id: { $in: ids } }); return HomebrewModel.deleteMany({ _id: { $in: ids } });
}).then((result)=>{ }).then((result)=>{
res.json({ count: result.deletedCount }); res.json({ count: result.deletedCount });