Skip to content
Snippets Groups Projects
Commit 244e90eb authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Only serialize if the values have actually changed.

Do not serialize the status XML if the actual value of ServiceSuspended
and / or LimitReason has not really changed. This effectively prevent
the "heartbeat" value (LastStatusUpdate) from being updated once per
AutoTx timer cycle.
parent fdc6757f
Branches
Tags
No related merge requests found
...@@ -154,6 +154,8 @@ namespace ATxCommon.Serializables ...@@ -154,6 +154,8 @@ namespace ATxCommon.Serializables
public string LimitReason { public string LimitReason {
get { return _limitReason; } get { return _limitReason; }
set { set {
if (_limitReason == value) return;
_limitReason = value; _limitReason = value;
Log.Trace("LimitReason was updated ({0}).", value); Log.Trace("LimitReason was updated ({0}).", value);
Serialize(); Serialize();
...@@ -192,6 +194,8 @@ namespace ATxCommon.Serializables ...@@ -192,6 +194,8 @@ namespace ATxCommon.Serializables
public bool ServiceSuspended { public bool ServiceSuspended {
get { return _serviceSuspended; } get { return _serviceSuspended; }
set { set {
if (_serviceSuspended == value) return;
_serviceSuspended = value; _serviceSuspended = value;
Log.Trace("ServiceSuspended was updated ({0}).", value); Log.Trace("ServiceSuspended was updated ({0}).", value);
Serialize(); Serialize();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment