mirror of
https://github.com/foomo/contentserver.git
synced 2025-10-16 12:25:44 +00:00
fix: race
This commit is contained in:
parent
6c104da662
commit
7a588bd108
@ -32,7 +32,7 @@ func (r *Repo) PollRoutine(ctx context.Context) error {
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
l.Debug("routine canceled", zap.Error(ctx.Err()))
|
l.Debug("routine canceled")
|
||||||
return nil
|
return nil
|
||||||
case <-ticker.C:
|
case <-ticker.C:
|
||||||
chanReponse := make(chan updateResponse)
|
chanReponse := make(chan updateResponse)
|
||||||
@ -52,7 +52,7 @@ func (r *Repo) UpdateRoutine(ctx context.Context) error {
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
l.Debug("routine canceled", zap.Error(ctx.Err()))
|
l.Debug("routine canceled")
|
||||||
return nil
|
return nil
|
||||||
case resChan := <-r.updateInProgressChannel:
|
case resChan := <-r.updateInProgressChannel:
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user