-
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
Clear Queue bug #120
Comments
https://github.com/mvk13ogb/qwait/tree/clearqueuebugfix seems to solve the problem but I think the solution is kind of ugly. @dflemstr, is there any better way of doing this that you can think of? |
@cwinsnes try to reuse the existing methods on the |
I changed the code so that it removes every queue position using deleteQueuePosition. Does that look better? I also removed the message on the message bus that said QueueCleared since everyone already is removed when having iterated through the list, but that could of course be readded if there is another reason to do this. There is a race condition in this code though, since someone could join the queue while the queue is getting cleared. Could that me remedied by locking the queue before the loop and unlocking after or should something else be done about that? |
The SQL transaction ensures that nobody can join the queue while it is being cleared. The idea was that the |
If you are in a queue that gets cleared by a queue owner, trying to queue in another queue before refreshing the page results in a warning that you are already in a queue.
The text was updated successfully, but these errors were encountered: