hotfix in sql query on entries
This commit is contained in:
parent
4e68821594
commit
99a03bac5d
@ -31,9 +31,9 @@ func (u *User) Init(cfg *config.Config) (err error) {
|
|||||||
// GetEntry returns requested acme ressource in database relative to domain
|
// GetEntry returns requested acme ressource in database relative to domain
|
||||||
func (u *User) GetEntry(cfg *config.Config, domains []string) (Entry cert.Entry, 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(
|
has, err := cfg.Db.Where("domains = ?", strings.Join(domains, ",")).And(
|
||||||
fmt.Sprintf("validity_end::timestamp-'%d DAY'::INTERVAL >= now()", cfg.ACME.MaxDaysBefore)).Where(
|
"auth_url = ?", cfg.ACME.AuthURL).And(
|
||||||
"auth_url = ?", cfg.ACME.AuthURL).Desc(
|
fmt.Sprintf("validity_end::timestamp-'%d DAY'::INTERVAL >= now()", cfg.ACME.MaxDaysBefore)).Desc(
|
||||||
"id").Get(&Entry)
|
"id").Get(&Entry)
|
||||||
|
|
||||||
fmt.Println(has, err)
|
fmt.Println(has, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user