Skip to content
Snippets Groups Projects
Commit 8c159d22 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Move zero-sized transfer dirs out of the way

Otherwise AutoTx will try to process them in each iteration but fail
right away, thus blocking all other transfers while the dir is there.

Fixes #49
parent e3dcf8d4
No related branches found
No related tags found
No related merge requests found
...@@ -26,6 +26,11 @@ namespace ATxService ...@@ -26,6 +26,11 @@ namespace ATxService
if (totalSize == 0) { if (totalSize == 0) {
Log.Warn("Total size of all files in [{0}] is zero, NOT STARTING a transfer!", Log.Warn("Total size of all files in [{0}] is zero, NOT STARTING a transfer!",
sourcePath); sourcePath);
// we also have to move it out of the way, otherwise it will block all transfers:
var sourceDir = new DirectoryInfo(sourcePath);
var errorTargetPath = Path.Combine(_config.ErrorPath, TimeUtils.Timestamp());
sourceDir.MoveTo(errorTargetPath);
Log.Warn("Moved empty directory tree [{0}] to [{1}].", sourcePath, errorTargetPath);
return; return;
} }
Log.Debug("Size of all files under [{0}] is {1} bytes ({2})", Log.Debug("Size of all files under [{0}] is {1} bytes ({2})",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment