refactor: add Safe everywhere is needing.
This commit is contained in:
parent
3174fb8861
commit
c36e0b3b06
8 changed files with 30 additions and 19 deletions
|
@ -80,7 +80,7 @@ func (d *Datastore) watchChanges() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
go func() {
|
||||
safe.Go(func() {
|
||||
ctx, cancel := context.WithCancel(d.ctx)
|
||||
operation := func() error {
|
||||
for {
|
||||
|
@ -113,7 +113,7 @@ func (d *Datastore) watchChanges() error {
|
|||
if err != nil {
|
||||
log.Errorf("Error in watch datastore: %v", err)
|
||||
}
|
||||
}()
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue