hotfix on pki on sql error
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing

This commit is contained in:
Paul 2021-06-25 09:29:57 +02:00
parent 62af54fbb8
commit 4e23987412

View File

@ -32,10 +32,12 @@ func (u *User) Init(cfg *config.Config) (err error) {
func (u *User) GetEntry(cfg *config.Config, domains []string) (Entry cert.Entry, err error) {
has, err := cfg.Db.Where("domains = ?", strings.Join(domains, ",")).Where(
"validity_end::timestamp-'? DAY'::INTERVAL >= now()", cfg.ACME.MaxDaysBefore).Where(
fmt.Sprintf("validity_end::timestamp-'%d DAY'::INTERVAL >= now()", cfg.ACME.MaxDaysBefore)).Where(
"auth_url = ?", cfg.ACME.AuthURL).Desc(
"id").Get(&Entry)
fmt.Println(has, err)
if !has {
err = fmt.Errorf("entry doesn't exists")
}