Skip to content

Commit

Permalink
do not remove info files on cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cenkalti committed Apr 18, 2019
1 parent f51b2f9 commit 90fcb34
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cleandisk.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ func (s *Server) visitFile(path string, f os.FileInfo, err error) error {
s.log.Debugln("File is newer than", ttl)
return nil
}
if filepath.Ext(path) != ".fid" {
s.log.Infoln("extension is not fid:", path, "; removing...")
ext := filepath.Ext(path)
if ext != ".fid" && ext != ".info" {
s.log.Infoln("extension is not \".fid\" or \".info\":", path, "; removing...")
err = os.Remove(path)
if err != nil {
s.log.Errorln("Cannot remove file:", err.Error())
Expand Down

0 comments on commit 90fcb34

Please sign in to comment.