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
8f551e77
Commit
8f551e77
authored
6 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Remember config validation warnings and report to the admin
Fixes
#51
parent
ef3de89b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ATxCommon/Serializables/ServiceConfig.cs
+7
-2
7 additions, 2 deletions
ATxCommon/Serializables/ServiceConfig.cs
ATxService/AutoTx.cs
+6
-0
6 additions, 0 deletions
ATxService/AutoTx.cs
with
13 additions
and
2 deletions
ATxCommon/Serializables/ServiceConfig.cs
+
7
−
2
View file @
8f551e77
...
@@ -288,6 +288,9 @@ namespace ATxCommon.Serializables
...
@@ -288,6 +288,9 @@ namespace ATxCommon.Serializables
}
}
}
}
[
XmlIgnore
]
public
static
string
ValidatorWarnings
{
get
;
set
;
}
#
endregion
#
endregion
...
@@ -391,8 +394,10 @@ namespace ATxCommon.Serializables
...
@@ -391,8 +394,10 @@ namespace ATxCommon.Serializables
SubOptimal
(
value
.
ToString
(),
name
,
"value is set very high, please check!"
);
SubOptimal
(
value
.
ToString
(),
name
,
"value is set very high, please check!"
);
}
}
void
SubOptimal
(
string
value
,
string
name
,
string
msg
)
{
void
SubOptimal
(
string
value
,
string
name
,
string
message
)
{
Log
.
Warn
(
">>> Sub-optimal setting detected: <{0}> [{1}] {2}"
,
name
,
value
,
msg
);
var
msg
=
$">>> Sub-optimal setting detected: <
{
name
}
> [
{
value
}
]
{
message
}
"
;
ValidatorWarnings
+=
msg
+
"\n"
;
Log
.
Warn
(
msg
);
}
}
void
LogAndThrow
(
string
msg
)
{
void
LogAndThrow
(
string
msg
)
{
...
...
This diff is collapsed.
Click to expand it.
ATxService/AutoTx.cs
+
6
−
0
View file @
8f551e77
...
@@ -415,6 +415,12 @@ namespace ATxService
...
@@ -415,6 +415,12 @@ namespace ATxService
}
}
Log
.
Debug
(
msg
);
Log
.
Debug
(
msg
);
// finally check if the validation gave warnings and send them to the admin:
var
warnings
=
ServiceConfig
.
ValidatorWarnings
;
if
(
string
.
IsNullOrWhiteSpace
(
warnings
))
return
;
SendAdminEmail
(
warnings
);
}
}
#
endregion
#
endregion
...
...
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