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
dc935361
Commit
dc935361
authored
7 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Fix calculations of time span values.
parent
3d8e7875
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
AutoTx/AutoTx.cs
+3
-3
3 additions, 3 deletions
AutoTx/AutoTx.cs
AutoTx/Email.cs
+7
-4
7 additions, 4 deletions
AutoTx/Email.cs
with
10 additions
and
7 deletions
AutoTx/AutoTx.cs
+
3
−
3
View file @
dc935361
...
...
@@ -399,8 +399,8 @@ namespace AutoTx
CheckFreeDiskSpace
();
UpdateServiceState
();
var
delta
=
DateTime
.
Now
-
_lastUserDirCheck
;
if
(
delta
.
Seconds
>=
120
)
var
delta
=
(
int
)(
DateTime
.
Now
-
_lastUserDirCheck
).
TotalSeconds
;
if
(
delta
>=
120
)
CreateIncomingDirectories
();
// tasks depending on the service state:
...
...
@@ -970,7 +970,7 @@ namespace AutoTx
private
Dictionary
<
string
,
List
<
Tuple
<
DirectoryInfo
,
long
,
int
>>>
ExpiredDirs
(
int
thresh
)
{
var
collection
=
new
Dictionary
<
string
,
List
<
Tuple
<
DirectoryInfo
,
long
,
int
>>>();
var
graceDir
=
new
DirectoryInfo
(
Path
.
Combine
(
_managedPath
,
"DONE"
));
var
now
=
DateTime
.
Utc
Now
;
var
now
=
DateTime
.
Now
;
foreach
(
var
userdir
in
graceDir
.
GetDirectories
())
{
var
expired
=
new
List
<
Tuple
<
DirectoryInfo
,
long
,
int
>>();
foreach
(
var
subdir
in
userdir
.
GetDirectories
())
{
...
...
This diff is collapsed.
Click to expand it.
AutoTx/Email.cs
+
7
−
4
View file @
dc935361
...
...
@@ -80,9 +80,12 @@ namespace AutoTx
if
(
_config
.
SendAdminNotification
==
false
)
return
;
var
delta
=
DateTime
.
Now
-
_status
.
LastAdminNotification
;
if
(
delta
.
Minutes
<
_config
.
AdminNotificationDelta
)
var
delta
=
(
int
)(
DateTime
.
Now
-
_status
.
LastAdminNotification
).
TotalMinutes
;
if
(
delta
<
_config
.
AdminNotificationDelta
)
{
writeLogDebug
(
"Suppressed admin email, interval too short ("
+
delta
+
" vs. "
+
_config
.
AdminNotificationDelta
+
"):\n\n"
+
subject
+
"\n"
+
body
);
return
;
}
if
(
subject
==
""
)
{
subject
=
ServiceName
+
...
...
@@ -103,8 +106,8 @@ namespace AutoTx
/// </summary>
/// <param name="spaceDetails">String describing the drives being low on space.</param>
public
void
SendLowSpaceMail
(
string
spaceDetails
)
{
var
delta
=
DateTime
.
Now
-
_status
.
LastStorageNotification
;
if
(
delta
.
Minutes
<
_config
.
StorageNotificationDelta
)
var
delta
=
(
int
)(
DateTime
.
Now
-
_status
.
LastStorageNotification
).
TotalMinutes
;
if
(
delta
<
_config
.
StorageNotificationDelta
)
return
;
writeLog
(
"WARNING: "
+
spaceDetails
);
...
...
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