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

Communicate admin command results to dashboard (pooling) #461

Closed
paulo-ocean opened this issue May 21, 2024 · 1 comment
Closed

Communicate admin command results to dashboard (pooling) #461

paulo-ocean opened this issue May 21, 2024 · 1 comment
Labels
Type: Enhancement New feature or request

Comments

@paulo-ocean
Copy link
Contributor

paulo-ocean commented May 21, 2024

This is a follow up of other PRs like #418 & #431
Since the dasboard is another app we can't listen to the events directly on the dashboard..
Also, as we're only serving/using static pages (not another node.js server) we don't have APIs or routes on the dashboard (so we can't call any API back either)

Implementing a more advanced messaging mechanism (queues, web sockets) is pretty much impossible task atm, unless we convert the dashboard to a fully node.js app (But currently the dashboard does not even build using other option than "output:export" on nextConfig, so that is another limitation.. and we probably don't need another full node.js app anyway

What we can do atm is have some sort of pooling mechanism to get the status of the latest admin commands...
When we issue the admin commands, we get a "job id" as part of the 200 response, so we can ask about his execution a few seconds later.. (right now we just send a random msg saying the command was delivered without follow up)

When we catch/listen the events, we update the job status on the list of "pending execution"

Once the job is cleared/finished and dashboard has received that info at least once, the job is cleared permanently from the list

@paulo-ocean paulo-ocean added the Type: Enhancement New feature or request label May 21, 2024
@paulo-ocean
Copy link
Contributor Author

closed on #464

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant