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
3d8205ca
Commit
3d8205ca
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Improve method names and log messages.
parent
5d9eaf29
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
AutoTx/AutoTx.cs
+8
-7
8 additions, 7 deletions
AutoTx/AutoTx.cs
AutoTx/RoboCommand.cs
+2
-2
2 additions, 2 deletions
AutoTx/RoboCommand.cs
with
10 additions
and
9 deletions
AutoTx/AutoTx.cs
+
8
−
7
View file @
3d8205ca
...
@@ -600,15 +600,15 @@ namespace AutoTx
...
@@ -600,15 +600,15 @@ namespace AutoTx
// if we're paused, resume the transfer and DO NOTHING ELSE:
// if we're paused, resume the transfer and DO NOTHING ELSE:
if
(
_transferState
==
TxState
.
Paused
)
{
if
(
_transferState
==
TxState
.
Paused
)
{
ResumeTransfer
();
Resume
Paused
Transfer
();
return
;
return
;
}
}
// first check if there are finished transfers and clean them up:
// first check if there are finished transfers and clean them up:
CheckFinished
Transfers
();
Finalize
Transfers
();
// next check if there is a transfer that has to be resumed:
// next check if there is a transfer that has to be resumed:
CheckTransfersToResume
();
ResumeInterruptedTransfer
();
// check if any of the above calls changed the transfer state:
// check if any of the above calls changed the transfer state:
if
(
_transferState
!=
TxState
.
Stopped
)
if
(
_transferState
!=
TxState
.
Stopped
)
...
@@ -660,7 +660,7 @@ namespace AutoTx
...
@@ -660,7 +660,7 @@ namespace AutoTx
/// to the final (user) destination and by locally moving the transferred folders to the
/// to the final (user) destination and by locally moving the transferred folders to the
/// grace location for deferred deletion.
/// grace location for deferred deletion.
/// </summary>
/// </summary>
private
void
CheckFinished
Transfers
()
{
private
void
Finalize
Transfers
()
{
// NOTE: this is intentionally triggered by the timer only to make sure the cleanup
// NOTE: this is intentionally triggered by the timer only to make sure the cleanup
// only happens while all system parameters are within their valid ranges
// only happens while all system parameters are within their valid ranges
...
@@ -689,9 +689,10 @@ namespace AutoTx
...
@@ -689,9 +689,10 @@ namespace AutoTx
}
}
/// <summary>
/// <summary>
/// Check if conditions for resuming a transfer are met and do so if true.
/// Check if an interrupted (service shutdown) transfer exists and whether the current
/// state allows for resuming it.
/// </summary>
/// </summary>
private
void
CheckTransfersToResume
()
{
private
void
ResumeInterruptedTransfer
()
{
// CONDITIONS (a transfer has to be resumed):
// CONDITIONS (a transfer has to be resumed):
// - CurrentTargetTmp has to be non-empty
// - CurrentTargetTmp has to be non-empty
// - TransferState has to be "Stopped"
// - TransferState has to be "Stopped"
...
@@ -701,7 +702,7 @@ namespace AutoTx
...
@@ -701,7 +702,7 @@ namespace AutoTx
_status
.
TransferInProgress
==
false
)
_status
.
TransferInProgress
==
false
)
return
;
return
;
writeLogDebug
(
"Resuming transfer from '"
+
_status
.
CurrentTransferSrc
+
writeLogDebug
(
"Resuming
interrupted
transfer from '"
+
_status
.
CurrentTransferSrc
+
"' to '"
+
ExpandCurrentTargetTmp
()
+
"'"
);
"' to '"
+
ExpandCurrentTargetTmp
()
+
"'"
);
StartTransfer
(
_status
.
CurrentTransferSrc
);
StartTransfer
(
_status
.
CurrentTransferSrc
);
}
}
...
...
This diff is collapsed.
Click to expand it.
AutoTx/RoboCommand.cs
+
2
−
2
View file @
3d8205ca
...
@@ -96,12 +96,12 @@ namespace AutoTx
...
@@ -96,12 +96,12 @@ namespace AutoTx
/// <summary>
/// <summary>
/// Resume a previously paused transfer.
/// Resume a previously paused transfer.
/// </summary>
/// </summary>
private
void
ResumeTransfer
()
{
private
void
Resume
Paused
Transfer
()
{
// only proceed when in a valid state:
// only proceed when in a valid state:
if
(
_transferState
!=
TxState
.
Paused
)
if
(
_transferState
!=
TxState
.
Paused
)
return
;
return
;
writeLog
(
"Resuming the
active
transfer..."
);
writeLog
(
"Resuming the
paused
transfer..."
);
_roboCommand
.
Resume
();
_roboCommand
.
Resume
();
_transferState
=
TxState
.
Active
;
_transferState
=
TxState
.
Active
;
writeLogDebug
(
"Transfer resumed"
);
writeLogDebug
(
"Transfer resumed"
);
...
...
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