mirror of
https://github.com/nodemailer/wildduck.git
synced 2025-01-04 07:02:45 +08:00
17 lines
564 B
JavaScript
17 lines
564 B
JavaScript
'use strict';
|
|
|
|
const log = require('npmlog');
|
|
const config = require('wild-config');
|
|
|
|
let run = async (task, data, options) => {
|
|
const { getCertificate, certHandler } = options;
|
|
let cert = await getCertificate(data.servername, config.acme, certHandler);
|
|
log.verbose('Tasks', 'task=acme id=%s servername=%s status=%s', task._id, data.servername, cert && cert.status);
|
|
return true;
|
|
};
|
|
|
|
module.exports = (task, data, options, callback) => {
|
|
run(task, data, options)
|
|
.then(response => callback(null, response))
|
|
.catch(callback);
|
|
};
|