Skip to content

Commit

Permalink
Merge pull request #220 from maxmind/greg/verbose-fix
Browse files Browse the repository at this point in the history
Still exit if hashes are equal and verbose is false
  • Loading branch information
ugexe authored Apr 13, 2023
2 parents 9b65afd + 287cd33 commit 2227ee2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 5.0.2

* "Database ... up to date" messages are now only shown if the verbose
flag is set. Pull request by Adam Weinberger. GitHub #219.

## 5.0.1 (2023-04-13)

* The 5.0.0 release mistakenly set the file permissions on downloaded
Expand Down
6 changes: 4 additions & 2 deletions pkg/geoipupdate/database/local_file_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@ func NewLocalFileWriter(
// Write writes the result struct returned by a Reader to a database file.
func (w *LocalFileWriter) Write(result *ReadResult) error {
// exit early if we've got the latest database version.
if w.verbose && strings.EqualFold(result.oldHash, result.newHash) {
log.Printf("Database %s up to date", result.editionID)
if strings.EqualFold(result.oldHash, result.newHash) {
if w.verbose {
log.Printf("Database %s up to date", result.editionID)
}
return nil
}

Expand Down

0 comments on commit 2227ee2

Please sign in to comment.