From 255886bca16486d13b18ac19cb6f1f0a0112f560 Mon Sep 17 00:00:00 2001 From: Dmitry Mishin Date: Wed, 8 May 2019 13:20:28 -0700 Subject: [PATCH] Log empty folders --- Makefile | 2 +- workers.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8428d84..7a17793 100644 --- a/Makefile +++ b/Makefile @@ -2,4 +2,4 @@ build: GOOS=linux GOARCH=amd64 go build upload: - scp pdm dmishin@oasis-bobcat:/home/dmishin/ + scp pdm dmishin@oasis-bobcat:/home/dmishin/pdm/ diff --git a/workers.go b/workers.go index 3104e6b..48d19c2 100644 --- a/workers.go +++ b/workers.go @@ -504,7 +504,10 @@ func processFolder(fromDataStore storage_backend, toDataStore storage_backend, t return err } + count := 0 + for dir := range dirsChan { + count++ msgTask := task{ "copy", dir} @@ -526,6 +529,7 @@ func processFolder(fromDataStore storage_backend, toDataStore storage_backend, t } for files := range filesChan { + count++ msgTask := task{ "copy", files} @@ -540,6 +544,10 @@ func processFolder(fromDataStore storage_backend, toDataStore storage_backend, t pubChan <- msg } + if count == 0 { + logger.Errorf("Folder %s is empty", dirPath) + } + case "clear": if dirPath != "/" { _, err := fromDataStore.GetMetadata(dirPath)