diff --git a/index.js b/index.js index 87672b2..9687c94 100644 --- a/index.js +++ b/index.js @@ -74,7 +74,7 @@ const plugin = { plugin.log.warn('[Cleaner Plugin] _tick already in progress, skipping') return } - plugin.log.debug('[Cleaner Plugin] _tick started, locking it') + // plugin.log.debug('[Cleaner Plugin] _tick started, locking it') plugin._isTickRunning = true try { @@ -103,7 +103,7 @@ const plugin = { start_datetime: { [Op.lt]: cut_datetime/1000 }, [Op.or]: [ {end_datetime: { [Op.lt]: cut_datetime/1000 } }, { end_datetime: null } ] }, - order: [['end_datetime', 'ASC']], + order: [['start_datetime', 'ASC']], include: [{ model: Event, as:'child' }], limit: plugin.settings.events_number, }) @@ -121,8 +121,8 @@ const plugin = { try { const old_path = path.join(config.upload_path, e.media[0].url) const old_thumb_path = path.join(config.upload_path, 'thumb', e.media[0].url) - await fs.unlink(old_thumb_path) - await fs.unlink(old_path) + //await fs.unlink(old_thumb_path) + //await fs.unlink(old_path) plugin.log.debug("[Cleaner Plugin] removing file: " + old_path) } catch (excep) { plugin.log.error("[Cleaner Plugin] error removing file %s", excep.toString()) @@ -152,7 +152,7 @@ const plugin = { } catch (e) { plugin.log.error(`[Cleaner Plugin] Uncaught error in _tick: ${String(e)}`) } finally { - plugin.log.debug('[Cleaner Plugin] _tick finished, unlocking it') + // plugin.log.debug('[Cleaner Plugin] _tick finished, unlocking it') plugin._isTickRunning = false } }