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
66355b47
Commit
66355b47
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Rename path variables for status and config files.
Just for laziness reasons, to facilitate auto-completion.
parent
a6d00d78
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
+11
-11
11 additions, 11 deletions
AutoTx/AutoTx.cs
with
11 additions
and
11 deletions
AutoTx/AutoTx.cs
+
11
−
11
View file @
66355b47
...
@@ -23,8 +23,8 @@ namespace AutoTx
...
@@ -23,8 +23,8 @@ namespace AutoTx
// naming convention: variables ending with "Path" are strings, variables
// naming convention: variables ending with "Path" are strings, variables
// ending with "Dir" are DirectoryInfo objects
// ending with "Dir" are DirectoryInfo objects
private
string
_
c
onfig
Path
;
private
string
_
pathToC
onfig
;
private
string
_
s
tatus
Path
;
private
string
_
pathToS
tatus
;
private
string
_incomingPath
;
private
string
_incomingPath
;
private
string
_managedPath
;
private
string
_managedPath
;
...
@@ -164,8 +164,8 @@ namespace AutoTx
...
@@ -164,8 +164,8 @@ namespace AutoTx
try
{
try
{
_transferState
=
TxState
.
Stopped
;
_transferState
=
TxState
.
Stopped
;
var
baseDir
=
AppDomain
.
CurrentDomain
.
BaseDirectory
;
var
baseDir
=
AppDomain
.
CurrentDomain
.
BaseDirectory
;
_
c
onfig
Path
=
Path
.
Combine
(
baseDir
,
"configuration.xml"
);
_
pathToC
onfig
=
Path
.
Combine
(
baseDir
,
"configuration.xml"
);
_
s
tatus
Path
=
Path
.
Combine
(
baseDir
,
"status.xml"
);
_
pathToS
tatus
=
Path
.
Combine
(
baseDir
,
"status.xml"
);
LoadConfigXml
();
LoadConfigXml
();
LoadStatusXml
();
LoadStatusXml
();
...
@@ -190,14 +190,14 @@ namespace AutoTx
...
@@ -190,14 +190,14 @@ namespace AutoTx
/// </summary>
/// </summary>
private
void
LoadConfigXml
()
{
private
void
LoadConfigXml
()
{
try
{
try
{
_config
=
ServiceConfig
.
Deserialize
(
_
c
onfig
Path
);
_config
=
ServiceConfig
.
Deserialize
(
_
pathToC
onfig
);
_incomingPath
=
Path
.
Combine
(
_config
.
SourceDrive
,
_config
.
IncomingDirectory
);
_incomingPath
=
Path
.
Combine
(
_config
.
SourceDrive
,
_config
.
IncomingDirectory
);
_managedPath
=
Path
.
Combine
(
_config
.
SourceDrive
,
_config
.
ManagedDirectory
);
_managedPath
=
Path
.
Combine
(
_config
.
SourceDrive
,
_config
.
ManagedDirectory
);
Log
.
Debug
(
"Loaded config from [{0}]"
,
_
c
onfig
Path
);
Log
.
Debug
(
"Loaded config from [{0}]"
,
_
pathToC
onfig
);
}
}
catch
(
ConfigurationErrorsException
ex
)
{
catch
(
ConfigurationErrorsException
ex
)
{
Log
.
Error
(
"ERROR validating configuration file [{0}]: {1}"
,
Log
.
Error
(
"ERROR validating configuration file [{0}]: {1}"
,
_
c
onfig
Path
,
ex
.
Message
);
_
pathToC
onfig
,
ex
.
Message
);
throw
new
Exception
(
"Error validating configuration."
);
throw
new
Exception
(
"Error validating configuration."
);
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
...
@@ -216,14 +216,14 @@ namespace AutoTx
...
@@ -216,14 +216,14 @@ namespace AutoTx
/// </summary>
/// </summary>
private
void
LoadStatusXml
()
{
private
void
LoadStatusXml
()
{
try
{
try
{
Log
.
Debug
(
"Trying to load status from [{0}]"
,
_
s
tatus
Path
);
Log
.
Debug
(
"Trying to load status from [{0}]"
,
_
pathToS
tatus
);
_status
=
ServiceStatus
.
Deserialize
(
_
s
tatus
Path
,
_config
);
_status
=
ServiceStatus
.
Deserialize
(
_
pathToS
tatus
,
_config
);
Log
.
Debug
(
"Loaded status from [{0}]"
,
_
s
tatus
Path
);
Log
.
Debug
(
"Loaded status from [{0}]"
,
_
pathToS
tatus
);
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
// FIXME: combine log and admin-email!
// FIXME: combine log and admin-email!
var
msg
=
string
.
Format
(
"Error loading status XML from [{0}]: {1} {2}"
,
var
msg
=
string
.
Format
(
"Error loading status XML from [{0}]: {1} {2}"
,
_
s
tatus
Path
,
ex
.
Message
,
ex
.
StackTrace
);
_
pathToS
tatus
,
ex
.
Message
,
ex
.
StackTrace
);
Log
.
Error
(
msg
);
Log
.
Error
(
msg
);
SendAdminEmail
(
msg
);
SendAdminEmail
(
msg
);
// this should terminate the service process:
// this should terminate the service process:
...
...
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