-
-
Notifications
You must be signed in to change notification settings - Fork 335
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
core&ui&hydrojudge: allow users to manually sync data #905
base: master
Are you sure you want to change the base?
Conversation
之前开过一个 PR(#646),但是写的太烂了,最后删了。 |
let taskId: string | null = null; | ||
do { | ||
// eslint-disable-next-line no-await-in-loop | ||
taskId = await this.ctx.serial('problem/syncData', this.pdoc.domainId, this.pdoc.docId, this.pdoc.data, doneIds); |
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.
serial
only iterates listeners on local process, and won't talk to other web processes, emit
also the same.
only broadcast
will send the event to everyone.
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.
Are there any ways to get all the websocket connections? It seems that using the database is necessary
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.
Is using a new type of document
acceptable? Or reuse the information in status
collection?
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.
all web servers are intended to be stateless for horizontal scaling;
I'm thinking maybe adding a autoSync: string[]
(host/domainId/pid
) to judge config file might be a better solution and easily configurable using deployment tools like nix-deploy, ansible, or even system image.
Using server-push means those judges who joined later (scaled up) might get the sync event.
Allow users to manually sync data. Added a button in problem files page.
demo.webm