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

Improve method names and log messages.

parent 5d9eaf29
No related branches found
No related tags found
No related merge requests found
...@@ -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(); ResumePausedTransfer();
return; return;
} }
// first check if there are finished transfers and clean them up: // first check if there are finished transfers and clean them up:
CheckFinishedTransfers(); FinalizeTransfers();
// 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 CheckFinishedTransfers() { private void FinalizeTransfers() {
// 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);
} }
......
...@@ -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 ResumePausedTransfer() {
// 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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment