fix race
This commit is contained in:
1 parent
3d02fa550d
commit
75abb294c0
1 file changed
+2
@@ -103,7 +103,9 @@ type requestsRepository struct {
|
||||
}
|
||||
|
||||
func (r *requestsRepository) Insert(model []entity.Request) error {
|
||||
r.mx.Lock()
|
||||
r.cache = append(r.cache, model...)
|
||||
r.mx.Unlock()
|
||||
r.wg.Done()
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user