Fixes crash when logrotate fails

This commit is contained in:
chaptergy 2021-07-22 14:05:21 +02:00
parent ac0bb6bee2
commit 67e8ca6714
No known key found for this signature in database
GPG Key ID: BDFB615E550409E7

View File

@ -210,8 +210,10 @@ const setupLogrotation = () => {
const intervalTimeout = 1000 * 60 * 60 * 24 * 2; // 2 days const intervalTimeout = 1000 * 60 * 60 * 24 * 2; // 2 days
const runLogrotate = async () => { const runLogrotate = async () => {
try {
await utils.exec('logrotate /etc/logrotate.d/nginx-proxy-manager'); await utils.exec('logrotate /etc/logrotate.d/nginx-proxy-manager');
logger.info('Logrotate completed.'); logger.info('Logrotate completed.');
} catch (e) { logger.warn(e); }
}; };
logger.info('Logrotate Timer initialized'); logger.info('Logrotate Timer initialized');