mirror of
https://github.com/navidrome/navidrome.git
synced 2026-08-31 07:30:32 +00:00
Use a Waiter diode, to avoid constant CPU usage. Fixes #777
This commit is contained in:
parent
a59f2c1e4b
commit
99dbe34d0f
@ -7,12 +7,12 @@ import (
|
||||
)
|
||||
|
||||
type diode struct {
|
||||
d *diodes.Poller
|
||||
d *diodes.Waiter
|
||||
}
|
||||
|
||||
func newDiode(ctx context.Context, size int, alerter diodes.Alerter) *diode {
|
||||
return &diode{
|
||||
d: diodes.NewPoller(diodes.NewOneToOne(size, alerter), diodes.WithPollingContext(ctx)),
|
||||
d: diodes.NewWaiter(diodes.NewOneToOne(size, alerter), diodes.WithWaiterContext(ctx)),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user