Skip to content

Commit

Permalink
Logging for purge
Browse files Browse the repository at this point in the history
  • Loading branch information
dimm0 committed Apr 12, 2019
1 parent bc6bc6c commit 2a0d474
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ func processFiles(fromDataStore storage_backend, toDataStore storage_backend, ta

if fromDataStore.GetPurgeFilesOlder() > 0 && (time.Since(sourceAtime).Hours()/24.0 > float64(fromDataStore.GetPurgeFilesOlder())) {
//logger.Error(filepath)
logger.Infof("Deleting file %s", filepath)
if err := fromDataStore.Remove(filepath); err != nil {
logger.Errorf("Error deleting file %s: %s", filepath, err.Error())
}
Expand All @@ -356,6 +357,7 @@ func processFiles(fromDataStore storage_backend, toDataStore storage_backend, ta
if len(strings.Split(taskStruct.ItemPath[0], string(os.PathSeparator))) > 3 {
//purgeQueue <- "Dir "+path.Dir(taskStruct.ItemPath[0])
//logger.Error("Dir "+path.Dir(taskStruct.ItemPath[0]))
logger.Infof("Deleting dir %s", path.Dir(taskStruct.ItemPath[0]))
if err := fromDataStore.Remove(path.Dir(taskStruct.ItemPath[0])); err != nil {
logger.Errorf("Error deleting folder %s: %s", path.Dir(taskStruct.ItemPath[0]), err.Error())
}
Expand Down

0 comments on commit 2a0d474

Please sign in to comment.