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
f5212509
Commit
f5212509
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Convert CurrentTargetTmpFull into get-only property TxTargetTmp
parent
6194e1dc
No related branches found
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
+13
-10
13 additions, 10 deletions
ATxCommon/Serializables/ServiceStatus.cs
ATxService/AutoTx.cs
+2
-2
2 additions, 2 deletions
ATxService/AutoTx.cs
ATxService/RoboCommand.cs
+2
-2
2 additions, 2 deletions
ATxService/RoboCommand.cs
with
17 additions
and
14 deletions
ATxCommon/Serializables/ServiceStatus.cs
+
13
−
10
View file @
f5212509
...
...
@@ -184,7 +184,7 @@ namespace ATxCommon.Serializables
/// <summary>
/// The user account name that should receive the data from the currently running transfer.
/// See also <seealso cref="
Current
TargetTmp
Full
"/> on details for assembling the path that
/// See also <seealso cref="
Tx
TargetTmp"/> on details for assembling the path that
/// is being used as a temporary location while a transfer is in progress.
/// </summary>
public
string
TxTargetUser
{
...
...
@@ -282,18 +282,22 @@ namespace ATxCommon.Serializables
}
#
endregion
getter
/
setter
methods
#
region
getter
only
methods
/// <summary>
///
Helper method to generate t
he full path of the current temp directory.
///
T
he full path of the current
transfer's
temp directory
on the target storage
.
/// </summary>
/// <returns>A string with the path to the
las
t tmp dir.</returns>
public
string
Current
TargetTmp
Full
()
{
return
Path
.
Combine
(
_config
.
DestinationDirectory
,
/// <returns>A string with the path to the
curren
t tmp dir.</returns>
public
string
Tx
TargetTmp
=>
Path
.
Combine
(
_config
.
DestinationDirectory
,
_txTargetUser
,
_config
.
TmpTransferDir
,
Environment
.
MachineName
);
}
#
endregion
getter
only
methods
/// <summary>
/// Helper to set the service state, logging a message if the state has changed.
...
...
@@ -332,10 +336,9 @@ namespace ATxCommon.Serializables
}
// TxTargetUser
var
currentTargetTmpPath
=
s
.
CurrentTargetTmpFull
();
if
(
s
.
TxTargetUser
.
Length
>
0
&&
!
Directory
.
Exists
(
current
TargetTmp
Path
))
{
ReportInvalidStatus
(
"CurrentTargetTmpPath"
,
current
TargetTmp
Path
,
&&
!
Directory
.
Exists
(
s
.
Tx
TargetTmp
))
{
ReportInvalidStatus
(
"CurrentTargetTmpPath"
,
s
.
Tx
TargetTmp
,
"invalid temporary path of an unfinished transfer"
);
s
.
TxTargetUser
=
""
;
}
...
...
This diff is collapsed.
Click to expand it.
ATxService/AutoTx.cs
+
2
−
2
View file @
f5212509
...
...
@@ -753,7 +753,7 @@ namespace ATxService
Log
.
Debug
(
"Finalizing transfer, cleaning up target storage location..."
);
var
finalDst
=
DestinationPath
(
_status
.
TxTargetUser
);
if
(!
string
.
IsNullOrWhiteSpace
(
finalDst
))
{
if
(
FsUtils
.
MoveAllSubDirs
(
new
DirectoryInfo
(
_status
.
Current
TargetTmp
Full
()
),
if
(
FsUtils
.
MoveAllSubDirs
(
new
DirectoryInfo
(
_status
.
Tx
TargetTmp
),
finalDst
,
_config
.
EnforceInheritedACLs
))
{
_status
.
TxTargetUser
=
""
;
}
...
...
@@ -812,7 +812,7 @@ namespace ATxService
return
;
Log
.
Debug
(
"Resuming interrupted transfer from [{0}] to [{1}]"
,
_status
.
CurrentTransferSrc
,
_status
.
Current
TargetTmp
Full
()
);
_status
.
CurrentTransferSrc
,
_status
.
Tx
TargetTmp
);
StartTransfer
(
_status
.
CurrentTransferSrc
);
}
...
...
This diff is collapsed.
Click to expand it.
ATxService/RoboCommand.cs
+
2
−
2
View file @
f5212509
...
...
@@ -35,7 +35,7 @@ namespace ATxService
// the user name is expected to be the last part of sourcePath:
_status
.
TxTargetUser
=
new
DirectoryInfo
(
sourcePath
).
Name
;
FsUtils
.
CreateNewDirectory
(
_status
.
Current
TargetTmp
Full
()
,
false
);
FsUtils
.
CreateNewDirectory
(
_status
.
Tx
TargetTmp
,
false
);
_transferState
=
TxState
.
Active
;
_status
.
TransferInProgress
=
true
;
...
...
@@ -49,7 +49,7 @@ namespace ATxService
// copy options
_roboCommand
.
CopyOptions
.
Source
=
sourcePath
;
_roboCommand
.
CopyOptions
.
Destination
=
_status
.
Current
TargetTmp
Full
()
;
_roboCommand
.
CopyOptions
.
Destination
=
_status
.
Tx
TargetTmp
;
// limit the transfer bandwidth by waiting between packets:
_roboCommand
.
CopyOptions
.
InterPacketGap
=
_config
.
InterPacketGap
;
...
...
This diff is collapsed.
Click to expand it.
Niko Ehrenfeuchter
@ehrenfeu
·
6 years ago
Author
Owner
Relates to
#16 (closed)
Relates to #16
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