Skip to content

Commit

Permalink
Merge pull request #365 from JustAnotherArchivist/disable-download-co…
Browse files Browse the repository at this point in the history
…unter-without-limit

Only increment download counter on files that have a download limit
  • Loading branch information
stefanbenten authored Apr 25, 2021
2 parents 31ef712 + 6bd3e97 commit 941ec1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ func (s *Server) CheckMetadata(token, filename string, increaseDownload bool) (M
return metadata, errors.New("MaxDownloads expired.")
} else if !metadata.MaxDate.IsZero() && time.Now().After(metadata.MaxDate) {
return metadata, errors.New("MaxDate expired.")
} else if increaseDownload {
} else if metadata.MaxDownloads != -1 && increaseDownload {
// todo(nl5887): mutex?

// update number of downloads
Expand Down

0 comments on commit 941ec1f

Please sign in to comment.