Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Commits
ddee94d7
Commit
ddee94d7
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Move processing of queued dirs into separate method.
parent
3d8205ca
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
AutoTx/AutoTx.cs
+14
-2
14 additions, 2 deletions
AutoTx/AutoTx.cs
with
14 additions
and
2 deletions
AutoTx/AutoTx.cs
+
14
−
2
View file @
ddee94d7
...
...
@@ -610,17 +610,27 @@ namespace AutoTx
// next check if there is a transfer that has to be resumed:
ResumeInterruptedTransfer
();
// check if any of the above calls changed the transfer state:
// check the queueing location and dispatch new transfers:
ProcessQueuedDirectories
();
}
/// <summary>
/// Process directories in the queueing location, dispatching new transfers if applicable.
/// </summary>
private
void
ProcessQueuedDirectories
()
{
// only proceed when in a valid state:
if
(
_transferState
!=
TxState
.
Stopped
)
return
;
//
select next directory from "processing" for transfer
:
//
check the "processing" location for directories
:
var
processingDir
=
Path
.
Combine
(
_managedPath
,
"PROCESSING"
);
var
queued
=
new
DirectoryInfo
(
processingDir
).
GetDirectories
();
if
(
queued
.
Length
==
0
)
return
;
var
subdirs
=
queued
[
0
].
GetDirectories
();
// having no subdirectories should not happen in theory - in practice it could e.g. if
// an admin is moving around stuff while the service is operating, so better be safe:
if
(
subdirs
.
Length
==
0
)
{
writeLog
(
"WARNING: empty processing directory found: "
+
queued
[
0
].
Name
);
try
{
...
...
@@ -632,6 +642,8 @@ namespace AutoTx
}
return
;
}
// dispatch the next directory from "processing" for transfer:
try
{
StartTransfer
(
subdirs
[
0
].
FullName
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment