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
02ab2538
Commit
02ab2538
authored
6 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Add grace location summary to low space notification
Fixes
#41
parent
634a7b7c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ATxService/Email.cs
+8
-0
8 additions, 0 deletions
ATxService/Email.cs
with
8 additions
and
0 deletions
ATxService/Email.cs
+
8
−
0
View file @
02ab2538
...
@@ -116,6 +116,12 @@ namespace ATxService
...
@@ -116,6 +116,12 @@ namespace ATxService
return
;
return
;
}
}
// reaching this point means a notification will be sent to the admin, and in that
// case it makes sense to also include details about the grace location:
var
graceReport
=
FsUtils
.
GraceLocationSummary
(
new
DirectoryInfo
(
_config
.
DonePath
),
_config
.
GracePeriod
);
Log
.
Warn
(
"WARNING: {0}"
,
spaceDetails
);
Log
.
Warn
(
"WARNING: {0}"
,
spaceDetails
);
_status
.
LastStorageNotification
=
DateTime
.
Now
;
_status
.
LastStorageNotification
=
DateTime
.
Now
;
...
@@ -127,6 +133,8 @@ namespace ATxService
...
@@ -127,6 +133,8 @@ namespace ATxService
};
};
try
{
try
{
var
body
=
LoadMailTemplate
(
"DiskSpace-Low.txt"
,
substitutions
);
var
body
=
LoadMailTemplate
(
"DiskSpace-Low.txt"
,
substitutions
);
if
(
graceReport
.
Length
>
0
)
body
+=
$"\n\n--\n
{
graceReport
}
"
;
SendEmail
(
_config
.
AdminEmailAdress
,
"low disk space"
,
body
);
SendEmail
(
_config
.
AdminEmailAdress
,
"low disk space"
,
body
);
}
}
catch
(
Exception
ex
)
{
catch
(
Exception
ex
)
{
...
...
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