-
Notifications
You must be signed in to change notification settings - Fork 0
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
Mediaflux status long polling #861
Conversation
success() { | ||
const date = new Date(); | ||
// eslint-disable-next-line no-console | ||
console.log(`OK - count: ${checkCount} - ${date.toISOString()}`); |
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.
Leaving this console.log statements so that we can check that it is indeed making the calls and decreasing the frequency the longer the page stays loaded.
@@ -1,4 +1,2 @@ | |||
// Import all the channels to be used by Action Cable | |||
// | |||
|
|||
import './mediaflux_channel'; |
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.
This PR replaces the WebSockets/ActionCable implementation with a plain AJAX call with long polling.
88a1cfa
to
791aa27
Compare
@@ -6,12 +6,12 @@ | |||
</a> | |||
<div class="mediaflux"> | |||
Mediaflux Status | |||
<div class="mediaflux-status inactive"></div> | |||
<div class="mediaflux-status unknown"></div> |
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.
Display a brown circle when we have not checked the status (e.g. for a not logged in user)
Closing now that #862 is working in staging |
Notice that this PR is a draft. If James' work with WebSockets works in staging we won't need this PR, if it does not then this PR is a good backup plan.
Uses JavaScript long polling to check the status of Mediaflux. We check the status every 2 seconds when a page is loaded, and the longer the page stays loaded we slow down the checks (every 10 seconds, and then every 30 seconds). We could tweak these settings as we wish.
Below is an example on how this looks in staging: