Skip to content

Commit

Permalink
Merge pull request #2 from davidramiro/dependabot/go_modules/github.c…
Browse files Browse the repository at this point in the history
…om/labstack/echo/v4-4.10.2

build(deps): bump github.com/labstack/echo/v4 from 4.10.1 to 4.10.2
  • Loading branch information
davidramiro authored Feb 26, 2023
2 parents 9701368 + 87be43d commit 5175332
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ require (

require (
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/labstack/echo/v4 v4.10.1
github.com/labstack/echo/v4 v4.10.2
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/stretchr/testify v1.8.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ github.com/go-faker/faker/v4 v4.0.0/go.mod h1:uuNc0PSRxF8nMgjGrrrU4Nw5cF30Jc6Kd0
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
github.com/labstack/echo/v4 v4.10.1 h1:rB+D8In9PWjsp1OpHaqK+t04nQv/SBD1IoIcXCg0lpY=
github.com/labstack/echo/v4 v4.10.1/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k=
github.com/labstack/echo/v4 v4.10.2 h1:n1jAhnq/elIFTHr1EYpiYtyKgx4RW9ccVgkqByZaN2M=
github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k=
github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
Expand Down
8 changes: 8 additions & 0 deletions pkg/porkbun/porkbun.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"net/http"
"time"

"github.com/davidramiro/frigabun/internal/config"
"github.com/davidramiro/frigabun/internal/logger"
Expand Down Expand Up @@ -53,18 +54,25 @@ func (p *PorkbunDns) AddRecord() *PorkbunUpdateError {

queryErr := porkbunRequest.queryRecord(p)

time.Sleep(2 * time.Second)

if queryErr != nil && queryErr.Code == 409 {

logger.Log.Info().Msg("record exists, updating")
updateErr := porkbunRequest.updateRecord(p)

time.Sleep(2 * time.Second)

if updateErr != nil {
logger.Log.Error().Str("err", updateErr.Message).Msg("porkbun rejected updated record")
return &PorkbunUpdateError{Code: 400, Message: updateErr.Message}
}

} else {
createErr := porkbunRequest.createRecord(p)

time.Sleep(2 * time.Second)

if createErr != nil {
logger.Log.Error().Str("err", createErr.Message).Msg("porkbun rejected new record")
return &PorkbunUpdateError{Code: 400, Message: createErr.Message}
Expand Down

0 comments on commit 5175332

Please sign in to comment.