struct list ckch_inst; /* list of ckch_inst which uses this ckch_node */
struct list crtlist_entry; /* list of entries which use this store */
struct ckch_conf conf;
+ struct task *acme_task;
struct ebmb_node node;
char path[VAR_ARRAY];
};
goto err;
}
+ if (store->acme_task != NULL) {
+ memprintf(&err, "An ACME task is already running for certificate '%s'.\n", args[2]);
+ goto err;
+ }
+
if (store->conf.acme.id == NULL) {
memprintf(&err, "No ACME configuration defined for file '%s'.\n", args[2]);
goto err;
goto err;
}
+
+ task = task_new_anywhere();
+ if (!task)
+ goto err;
+ task->nice = 0;
+ task->process = acme_process;
+
+ /* register the task in the store so we don't
+ * have 2 tasks at the same time
+ */
+ store->acme_task = task;
+
HA_SPIN_UNLOCK(CKCH_LOCK, &ckch_lock);
ctx = calloc(1, sizeof *ctx);
goto err;
}
-
ctx->store = newstore;
ctx->cfg = cfg;
-
- task = task_new_anywhere();
- if (!task)
- goto err;
- task->nice = 0;
- task->process = acme_process;
task->context = ctx;
task_wakeup(task, TASK_WOKEN_INIT);