-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added feature to shutdown the logger properly if the server crashes unexpectedly #16
Conversation
56537fb
to
9bbd628
Compare
@@ -563,13 +576,26 @@ public void receivedTimestampOnly(long timestamp) | |||
{ | |||
synchronized (timestampUpdater) | |||
{ | |||
// We haven't received any new timestamps, shutdown the logger gracefully | |||
if (ticksWithoutNewTimestamp == TICKS_WITHOUT_DATA_BEFORE_SHUTDOWN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make this if (!alreadyShutDown && ticksWithoutNewTimestamp >= TICKS_WITHOUT_DATA_BEFORE_SHUTDOWN)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya good call
|
||
if (alreadyShutDown) | ||
{ | ||
LogTools.info("This may have already shutdown properly due to the server losing power for an extended amount of time"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily because of loss of power. I think you should just make this say This may have already shutdown properly because the connection to the YoVariableServer was lost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair, went with: "This may have already shutdown because the connection to the server was lost"
We need to get a certain amount of ticks in a row without a new timestamp, then we shutdown.
This is because if power is lost to the server the JVM doesn't shutdown properly, therefore we can keep logging useless data, this prevents that.