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
dacd9751
Commit
dacd9751
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Move ExpandCurrentTargetTmp to ServiceStatus.CurrentTargetTmpFull.
parent
c218ade5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ATXCommon/Serializables/ServiceStatus.cs
+12
-2
12 additions, 2 deletions
ATXCommon/Serializables/ServiceStatus.cs
AutoTx/AutoTx.cs
+3
-12
3 additions, 12 deletions
AutoTx/AutoTx.cs
AutoTx/RoboCommand.cs
+2
-2
2 additions, 2 deletions
AutoTx/RoboCommand.cs
with
17 additions
and
16 deletions
ATXCommon/Serializables/ServiceStatus.cs
+
12
−
2
View file @
dacd9751
...
...
@@ -19,8 +19,8 @@ namespace ATXCommon.Serializables
private
DateTime
_lastGraceNotification
;
private
string
_limitReason
;
string
_currentTransferSrc
;
string
_currentTargetTmp
;
private
string
_currentTransferSrc
;
private
string
_currentTargetTmp
;
bool
_transferInProgress
;
private
bool
_serviceSuspended
;
...
...
@@ -217,5 +217,15 @@ namespace ATXCommon.Serializables
"LastGraceNotification: "
+
LastGraceNotification
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
+
"\n"
;
}
/// <summary>
/// Helper method to generate the full path of the current temp directory.
/// </summary>
/// <returns>A string with the path to the last tmp dir.</returns>
public
string
CurrentTargetTmpFull
()
{
return
Path
.
Combine
(
_config
.
DestinationDirectory
,
_config
.
TmpTransferDir
,
_currentTargetTmp
);
}
}
}
This diff is collapsed.
Click to expand it.
AutoTx/AutoTx.cs
+
3
−
12
View file @
dacd9751
...
...
@@ -509,16 +509,6 @@ namespace AutoTx
#
region
transfer
tasks
/// <summary>
/// Helper method to generate the full path of the current temp directory.
/// </summary>
/// <returns>A string with the path to the last tmp dir.</returns>
private
string
ExpandCurrentTargetTmp
()
{
return
Path
.
Combine
(
_config
.
DestinationDirectory
,
_config
.
TmpTransferDir
,
_status
.
CurrentTargetTmp
);
}
/// <summary>
/// Assemble the transfer destination path and check if it exists.
/// </summary>
...
...
@@ -627,7 +617,8 @@ namespace AutoTx
Log
.
Debug
(
"Finalizing transfer, cleaning up target storage location..."
);
var
finalDst
=
DestinationPath
(
_status
.
CurrentTargetTmp
);
if
(!
string
.
IsNullOrWhiteSpace
(
finalDst
))
{
if
(
MoveAllSubDirs
(
new
DirectoryInfo
(
ExpandCurrentTargetTmp
()),
finalDst
,
true
))
{
if
(
MoveAllSubDirs
(
new
DirectoryInfo
(
_status
.
CurrentTargetTmpFull
()),
finalDst
,
true
))
{
_status
.
CurrentTargetTmp
=
""
;
}
}
...
...
@@ -658,7 +649,7 @@ namespace AutoTx
return
;
Log
.
Debug
(
"Resuming interrupted transfer from [{0}] to [{1}]"
,
_status
.
CurrentTransferSrc
,
Expand
CurrentTargetTmp
());
_status
.
CurrentTransferSrc
,
_status
.
CurrentTargetTmp
Full
());
StartTransfer
(
_status
.
CurrentTransferSrc
);
}
...
...
This diff is collapsed.
Click to expand it.
AutoTx/RoboCommand.cs
+
2
−
2
View file @
dacd9751
...
...
@@ -27,7 +27,7 @@ namespace AutoTx
// the user name is expected to be the last part of the path:
_status
.
CurrentTargetTmp
=
new
DirectoryInfo
(
sourcePath
).
Name
;
CreateNewDirectory
(
Expand
CurrentTargetTmp
(),
false
);
CreateNewDirectory
(
_status
.
CurrentTargetTmp
Full
(),
false
);
_transferState
=
TxState
.
Active
;
_status
.
TransferInProgress
=
true
;
...
...
@@ -39,7 +39,7 @@ namespace AutoTx
// copy options
_roboCommand
.
CopyOptions
.
Source
=
sourcePath
;
_roboCommand
.
CopyOptions
.
Destination
=
Expand
CurrentTargetTmp
();
_roboCommand
.
CopyOptions
.
Destination
=
_status
.
CurrentTargetTmp
Full
();
// limit the transfer bandwidth by waiting between packets:
_roboCommand
.
CopyOptions
.
InterPacketGap
=
_config
.
InterPacketGap
;
...
...
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