mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 02:15:48 +02:00
enhance(cert): do not create cert in db if issue failed
This commit is contained in:
parent
09671501e0
commit
6c7edf5c25
3 changed files with 23 additions and 19 deletions
|
@ -63,6 +63,11 @@ func FirstOrCreateCert(confName string, keyType certcrypto.KeyType) (c Cert, err
|
|||
return
|
||||
}
|
||||
|
||||
func FirstOrInit(confName string, keyType certcrypto.KeyType) (c Cert, err error) {
|
||||
err = db.FirstOrInit(&c, &Cert{Name: confName, Filename: confName, KeyType: keyType}).Error
|
||||
return
|
||||
}
|
||||
|
||||
func (c *Cert) Insert() error {
|
||||
return db.Create(c).Error
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue