Skip to content

Commit 540554c

Browse files
authored
Merge pull request NginxProxyManager#695 from chaptergy/failed-certificate-autoremove
Adds autoremove of failed certificate creations in DB
2 parents 5bc3e47 + 1518ecd commit 540554c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/internal/certificate.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,13 @@ const internalCertificate = {
216216
return saved_row;
217217
});
218218
});
219+
}).catch(async (error) => {
220+
// Delete the certificate from the database if it was not created successfully
221+
await certificateModel
222+
.query()
223+
.deleteById(certificate.id);
224+
225+
throw error;
219226
});
220227
} else {
221228
return certificate;

0 commit comments

Comments
 (0)