Merge pull request #137 from mutantmonkey/issue_136

Fix -nologs on linx-cleanup tool (closes #136)
This commit is contained in:
Andrei Marcu 2018-02-26 12:01:33 -08:00 committed by GitHub
commit 4fa6423a85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -34,11 +34,15 @@ func main() {
for _, filename := range files {
metadata, err := metaBackend.Get(filename)
if err != nil {
log.Printf("Failed to find metadata for %s", filename)
if !noLogs {
log.Printf("Failed to find metadata for %s", filename)
}
}
if expiry.IsTsExpired(metadata.Expiry) {
log.Printf("Delete %s", filename)
if !noLogs {
log.Printf("Delete %s", filename)
}
fileBackend.Delete(filename)
metaStorageBackend.Delete(filename)
}