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

✨ Use settings api to store queue config #222

Merged
merged 6 commits into from
Nov 8, 2024
Merged

✨ Use settings api to store queue config #222

merged 6 commits into from
Nov 8, 2024

Conversation

foysalit
Copy link
Contributor

@foysalit foysalit commented Oct 22, 2024

Depends on bluesky-social/atproto#2905

This PR moves queue config (queue list and seed) from env var to ozone settings API.

Screenshot 2024-10-23 at 12 13 42

Dark Mode

Screenshot 2024-10-23 at 12 14 20

Light mode

Comment on lines 439 to 440
function getQueueIndex(did: string, queueNames: string[], queueSeed: string) {
return simpleHash(did + queueSeed) % queueNames.length
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're making changes here, I might recommend flipping this around a little since I think it will work better with reshuffling based on the seed (given how the simple hash function works).

Suggested change
function getQueueIndex(did: string, queueNames: string[], queueSeed: string) {
return simpleHash(did + queueSeed) % queueNames.length
function getQueueIndex(did: string, queueNames: string[], queueSeed: string) {
return simpleHash(`${queueSeed}:${did}`) % queueNames.length

@arcalinea arcalinea temporarily deployed to ozone-settings - ozone-staging PR #222 November 8, 2024 20:08 — with Render Destroyed
@foysalit foysalit merged commit 6e4f373 into main Nov 8, 2024
3 checks passed
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.

3 participants