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
e413961b
Commit
e413961b
authored
6 years ago
by
Niko Ehrenfeuchter
Browse files
Options
Downloads
Patches
Plain Diff
Add SerializeHeartbeat()
parent
c5d69784
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/ServiceStatus.cs
+8
-0
8 additions, 0 deletions
ATxCommon/Serializables/ServiceStatus.cs
ATxService/AutoTx.cs
+1
-4
1 addition, 4 deletions
ATxService/AutoTx.cs
with
9 additions
and
4 deletions
ATxCommon/Serializables/ServiceStatus.cs
+
8
−
0
View file @
e413961b
...
...
@@ -75,6 +75,14 @@ namespace ATxCommon.Serializables
Log
.
Trace
(
"Finished serializing [{0}]."
,
_storageFile
);
}
/// <summary>
/// Wrapper to serialize XML if time since last is above threshold (default = 1 min).
/// </summary>
public
void
SerializeHeartbeat
(
int
timeout
=
60
)
{
if
(
TimeUtils
.
SecondsSince
(
_lastStatusUpdate
)
>=
timeout
)
Serialize
();
}
public
static
ServiceStatus
Deserialize
(
string
file
,
ServiceConfig
config
)
{
Log
.
Trace
(
"Trying to deserialize status XML file [{0}]."
,
file
);
ServiceStatus
status
;
...
...
This diff is collapsed.
Click to expand it.
ATxService/AutoTx.cs
+
1
−
4
View file @
e413961b
...
...
@@ -598,10 +598,7 @@ namespace ATxService
// mandatory tasks, run on every call:
SendLowSpaceMail
(
SystemChecks
.
CheckFreeDiskSpace
(
_config
.
SpaceMonitoring
));
UpdateServiceState
();
// update the status heartbeat at least once a minute:
if
(
TimeUtils
.
SecondsSince
(
_status
.
LastStatusUpdate
)
>=
60
)
_status
.
Serialize
();
_status
.
SerializeHeartbeat
();
if
(
TimeUtils
.
SecondsSince
(
_lastUserDirCheck
)
>=
120
)
CreateIncomingDirectories
();
...
...
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