Merge pull request #695 from chaptergy/failed-certificate-autoremove

Adds autoremove of failed certificate creations in DB
This commit is contained in:
jc21
2020-11-09 10:10:00 +10:00
committed by GitHub

View File

@ -216,6 +216,13 @@ const internalCertificate = {
return saved_row;
});
});
}).catch(async (error) => {
// Delete the certificate from the database if it was not created successfully
await certificateModel
.query()
.deleteById(certificate.id);
throw error;
});
} else {
return certificate;