Skip to content
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

Closed
wants to merge 7 commits into from

Conversation

hectorcorrea
Copy link
Member

@hectorcorrea hectorcorrea commented Jul 25, 2024

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:

Screenshot 2024-07-26 at 11 09 23 AM

success() {
const date = new Date();
// eslint-disable-next-line no-console
console.log(`OK - count: ${checkCount} - ${date.toISOString()}`);
Copy link
Member Author

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';
Copy link
Member Author

@hectorcorrea hectorcorrea Jul 26, 2024

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.

@hectorcorrea hectorcorrea marked this pull request as draft July 29, 2024 14:03
@hectorcorrea hectorcorrea force-pushed the mediaflux-status-long-polling branch from 88a1cfa to 791aa27 Compare July 29, 2024 20:52
@@ -6,12 +6,12 @@
</a>
<div class="mediaflux">
Mediaflux Status
<div class="mediaflux-status inactive"></div>
<div class="mediaflux-status unknown"></div>
Copy link
Member Author

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)

@hectorcorrea
Copy link
Member Author

Closing now that #862 is working in staging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants