-
Notifications
You must be signed in to change notification settings - Fork 17
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
Conversation
1549e12
to
49c58ea
Compare
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.
LGTM w/ suggestion to fix a TODO. And maybe add a changelog entry too?
handler.go
Outdated
// TODO: Switch to baseservice.NewArchetype when available. | ||
archetype: &baseservice.Archetype{ | ||
Logger: opts.Logger, | ||
Rand: randutil.NewCryptoSeededConcurrentSafeRand(), | ||
Time: &baseservice.UnStubbableTimeGenerator{}, | ||
}, |
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.
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,
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.
Yeah, good call. Done.
Also added changelog.
49c58ea
to
1fa1d18
Compare
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
1fa1d18
to
3defb39
Compare
Follows up [1] to move to
math/rand/v2
, which automatically seedsitself, and away from the internal random source that came in with
baseservice.Archetype
.[1] riverqueue/river#691