fix: remove nil error return
This commit is contained in:
@@ -48,17 +48,15 @@ func (c *Client) getSeasonList(ctx context.Context, page int, season string) (To
|
|||||||
}
|
}
|
||||||
|
|
||||||
// seedRandomPool seeds the in-memory pool of random anime
|
// seedRandomPool seeds the in-memory pool of random anime
|
||||||
func (c *Client) seedRandomPool(ctx context.Context) error {
|
func (c *Client) seedRandomPool(ctx context.Context) {
|
||||||
if !c.markRandomPoolInitialized() {
|
if !c.markRandomPoolInitialized() {
|
||||||
return nil
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
c.loadCachedRandomPool(ctx)
|
c.loadCachedRandomPool(ctx)
|
||||||
|
|
||||||
// Fetch a solid baseline in the background, then start refreshing.
|
// Fetch a solid baseline in the background, then start refreshing.
|
||||||
go c.seedRandomPoolBaseline()
|
go c.seedRandomPoolBaseline()
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Client) markRandomPoolInitialized() bool {
|
func (c *Client) markRandomPoolInitialized() bool {
|
||||||
@@ -207,7 +205,7 @@ func (c *Client) GetRandomAnime(ctx context.Context) (Anime, error) {
|
|||||||
c.poolMu.Unlock()
|
c.poolMu.Unlock()
|
||||||
|
|
||||||
if !initialized {
|
if !initialized {
|
||||||
_ = c.seedRandomPool(ctx)
|
c.seedRandomPool(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
c.poolMu.RLock()
|
c.poolMu.RLock()
|
||||||
|
|||||||
Reference in New Issue
Block a user