Skip to content

Commit

Permalink
skip update when no maxmind license present instead of erroring on do…
Browse files Browse the repository at this point in the history
…wnload
  • Loading branch information
HelmiRifai committed Jan 30, 2020
1 parent d2344d2 commit 8bcc14e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ip/maxmind.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ func (g *maxmind) update() error {
log.Debug("[geoip] update start")
defer log.Debug("[geoip] update finished")

if g.license == "" {
log.Debug("[geoip] no license, skip update")
return nil
}

if err := os.MkdirAll(maxmindDir, 0750); err != nil {
return fmt.Errorf("cannot create directory %s , error: %w", maxmindDir, err)
}
Expand Down

0 comments on commit 8bcc14e

Please sign in to comment.