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

Lock view page does not show current lock state correctly #77

Closed
anjackson opened this issue Mar 16, 2022 · 2 comments
Closed

Lock view page does not show current lock state correctly #77

anjackson opened this issue Mar 16, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@anjackson
Copy link
Contributor

anjackson commented Mar 16, 2022

The lock view page relies on the hash map stored under the session, but the actual locks are stored in separate keys. e.g. lock:web/19950418155600/http://portico.bl.uk/ = _SESSION_ID_.

When the latter timeout, that's all fine, and the lock is released to an item can be viewed by another.

However, the UI shows the web/19950418155600/http://portico.bl.uk/ as an entry in a hash set stored at the key SESSION_ID, and hash set entries can't have their own expiration. So, the _locks UI does not show the true locks state.

It's not terribly performant, but given we don't expect that many users, it would probably be fine to scan all locks and group them by session ID in memory, and show that instead.

Current session scanner is at

for sesh_key in session.redis.scan_iter(SESH_LIST.format('*')):

@anjackson
Copy link
Contributor Author

See also #76

@anjackson
Copy link
Contributor Author

Okay, modified to scan for locks and expire/drop ones that are gone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant