added log for lock error

This commit is contained in:
Andris Reinman 2021-06-21 14:28:40 +03:00
parent bb7c25c8e5
commit c50c5097f0
5 changed files with 7 additions and 9 deletions

View file

@ -18,6 +18,6 @@ email = "domainadmin@example.com" # must be valid email address
[agent] [agent]
# If enabled then starts a HTTP server that listens for ACME verification requests # If enabled then starts a HTTP server that listens for ACME verification requests
# If you have API already listening on port 80 then you don't need this # If you have API already listening on port 80 then you don't need this
enabled = true enabled = true
port = 7003 # use 80 in production port = 7003 # use 80 in production
redirect = "https://wildduck.email" # redirect requests unrelated to ACME updates to this URL redirect = "https://wildduck.email" # redirect requests unrelated to ACME updates to this URL

View file

@ -3848,8 +3848,6 @@ components:
- id - id
- action - action
- result - result
- sess
- ip
- created - created
type: object type: object
properties: properties:
@ -5893,8 +5891,6 @@ components:
- id - id
- action - action
- result - result
- sess
- ip
- created - created
type: object type: object
properties: properties:

View file

@ -307,6 +307,7 @@ const acquireCert = async (domain, acmeOptions, certificateData, certHandler) =>
try { try {
await releaseLock(lock); await releaseLock(lock);
} catch (err) { } catch (err) {
console.error(lock);
log.error('Lock', 'Failed to release lock for %s: %s', domainOpLockKey, err); log.error('Lock', 'Failed to release lock for %s: %s', domainOpLockKey, err);
} }
} }

View file

@ -77,7 +77,7 @@ module.exports = {
AUTHLOG_BUCKET: 6 * 3600 * 1000, AUTHLOG_BUCKET: 6 * 3600 * 1000,
// start processing tasks 5 minues after startup // start processing tasks 5 minues after startup
TASK_STARTUP_INTERVAL: 5 * 60 * 1000, TASK_STARTUP_INTERVAL: 1 * 60 * 1000,
// if no tasks were found, wait 5 seconds // if no tasks were found, wait 5 seconds
TASK_IDLE_INTERVAL: 5 * 1000, TASK_IDLE_INTERVAL: 5 * 1000,

View file

@ -460,6 +460,7 @@ async function runTasks() {
let startTime = Date.now(); let startTime = Date.now();
let done = false; let done = false;
log.verbose('Tasks', 'Starting task poll loop');
while (!done) { while (!done) {
if (Date.now() - startTime > 3600 * 1000) { if (Date.now() - startTime > 3600 * 1000) {
// Once in a while break the loop, so that pending tasks can be unlocked // Once in a while break the loop, so that pending tasks can be unlocked
@ -492,7 +493,7 @@ async function runTasks() {
} catch (err) { } catch (err) {
log.error('Tasks', 'Failed to process task queue error=%s', err.message); log.error('Tasks', 'Failed to process task queue error=%s', err.message);
} finally { } finally {
await timer(consts.TASK_STARTUP_INTERVAL); await timer(consts.TASK_IDLE_INTERVAL);
} }
} }