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

Move to math/rand/v2 and away from internal service rand #253

Merged
merged 1 commit into from
Dec 16, 2024

Conversation

brandur
Copy link
Collaborator

@brandur brandur commented Dec 16, 2024

Follows up [1] to move to math/rand/v2, which automatically seeds
itself, and away from the internal random source that came in with
baseservice.Archetype.

[1] riverqueue/river#691

Copy link
Contributor

@bgentry bgentry left a comment

Choose a reason for hiding this comment

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

LGTM w/ suggestion to fix a TODO. And maybe add a changelog entry too?

handler.go Outdated
Comment on lines 132 to 136
// TODO: Switch to baseservice.NewArchetype when available.
archetype: &baseservice.Archetype{
Logger: opts.Logger,
Rand: randutil.NewCryptoSeededConcurrentSafeRand(),
Time: &baseservice.UnStubbableTimeGenerator{},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Want to take care of this TODO too while in here? I think this does it:

-               // TODO: Switch to baseservice.NewArchetype when available.
-               archetype: &baseservice.Archetype{
-                       Logger: opts.Logger,
-                       Rand:   randutil.NewCryptoSeededConcurrentSafeRand(),
-                       Time:   &baseservice.UnStubbableTimeGenerator{},
-               },
-               client: opts.Client,
-               dbPool: opts.DB,
-               logger: opts.Logger,
+               archetype: baseservice.NewArchetype(opts.Logger),
+               client:    opts.Client,
+               dbPool:    opts.DB,
+               logger:    opts.Logger,

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, good call. Done.

Also added changelog.

Follows up [1] to move to `math/rand/v2`, which automatically seeds
itself, and away from the internal random source that came in with
`baseservice.Archetype`.

[1] riverqueue/river#691
@brandur brandur merged commit de15e57 into master Dec 16, 2024
12 checks passed
@brandur brandur deleted the brandur-rand-v2 branch December 16, 2024 16:22
brandur added a commit that referenced this pull request Dec 16, 2024
Shipping largely to get the changes from #253 to make sure there's a
River UI release out there that's compatible with River 0.14.3, but also
includes basic auth from #241.
@brandur brandur mentioned this pull request Dec 16, 2024
brandur added a commit that referenced this pull request Dec 16, 2024
Shipping largely to get the changes from #253 to make sure there's a
River UI release out there that's compatible with River 0.14.3, but also
includes basic auth from #241.
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.

2 participants