-
Notifications
You must be signed in to change notification settings - Fork 12
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
Issue #126 - Gracefully fail when database connection can't be made for playback #127
Conversation
Update the server endpoints and Playback class so a failed database connection doesn't prevent the GUI Plugin from functioning / booting normally. The Playback class tracks whether playback is "enabled" and the server endpoints use this status flag to determine how best to respond to requests.
Update the Playback component to display a warning banner if no valid time ranges were returned from the backend. This can either be because there's no valid time ranges of data in the database or (more likely) because the database connection isn't configured or failed.
@@ -127,21 +127,31 @@ class Playback(object): | |||
A Playback manages the state for the playback component. | |||
playback.dbconn: connection to database | |||
playback.query: time query map of {timestamp: list of (uid, data)} from database | |||
playback.on: true if gui is currently in playback mode | |||
playback.on: True if gui is currently in playback mode. Real-time telemetry will not | |||
be sent to the frontend during this. |
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.
Just curious, is stopping real-time telem during playback the intended functionality, or something to change in the future?
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.
That's intended. If we're playing back telemetry from a historical query we cut off the real time stream to the clients so the older data can be replayed.
When I test this without a database connection nothing shows up under the playback tab, should we add a statement saying playback is disabled? |
@aywaldron, did you build the static files? At the moment they're out of date in this PR so you won't see it by default. I planned to update master after we merge so we can be up-to-date with stuff. |
@MJJoyce Ok that explains it, since I saw the statement in the code. Sounds good then. |
Update the server endpoints and Playback component so they fail gracefully when a database connection cannot be made.
Resolve #126