mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-14 01:19:09 +02:00
fix concurrency and context
This commit is contained in:
@@ -187,7 +187,7 @@ func (m *managerImpl) DeleteNetwork(ctx context.Context, accountID, userID, netw
|
||||
event()
|
||||
}
|
||||
|
||||
go m.accountManager.ExpandAndUpdateAffected(ctx, accountID, snap, change)
|
||||
m.accountManager.ExpandAndUpdateAffected(ctx, accountID, snap, change)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ func (m *managerImpl) CreateResource(ctx context.Context, userID string, resourc
|
||||
event()
|
||||
}
|
||||
|
||||
go m.accountManager.ExpandAndUpdateAffected(ctx, resource.AccountID, snap, change)
|
||||
m.accountManager.ExpandAndUpdateAffected(ctx, resource.AccountID, snap, change)
|
||||
|
||||
return resource, nil
|
||||
}
|
||||
@@ -297,7 +297,7 @@ func (m *managerImpl) UpdateResource(ctx context.Context, userID string, resourc
|
||||
}
|
||||
}()
|
||||
|
||||
go m.accountManager.ExpandAndUpdateAffected(ctx, resource.AccountID, snap, change)
|
||||
m.accountManager.ExpandAndUpdateAffected(ctx, resource.AccountID, snap, change)
|
||||
|
||||
return resource, nil
|
||||
}
|
||||
@@ -397,7 +397,7 @@ func (m *managerImpl) DeleteResource(ctx context.Context, accountID, userID, net
|
||||
event()
|
||||
}
|
||||
|
||||
go m.accountManager.ExpandAndUpdateAffected(ctx, accountID, snap, change)
|
||||
m.accountManager.ExpandAndUpdateAffected(ctx, accountID, snap, change)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -126,7 +126,7 @@ func (m *managerImpl) CreateRouter(ctx context.Context, userID string, router *t
|
||||
|
||||
m.accountManager.StoreEvent(ctx, userID, router.ID, router.AccountID, activity.NetworkRouterCreated, router.EventMeta(network))
|
||||
|
||||
go m.accountManager.ExpandAndUpdateAffected(ctx, router.AccountID, snap, change)
|
||||
m.accountManager.ExpandAndUpdateAffected(ctx, router.AccountID, snap, change)
|
||||
|
||||
return router, nil
|
||||
}
|
||||
@@ -175,7 +175,7 @@ func (m *managerImpl) UpdateRouter(ctx context.Context, userID string, router *t
|
||||
|
||||
m.accountManager.StoreEvent(ctx, userID, router.ID, router.AccountID, activity.NetworkRouterUpdated, router.EventMeta(network))
|
||||
|
||||
go m.accountManager.ExpandAndUpdateAffected(ctx, router.AccountID, snap, change)
|
||||
m.accountManager.ExpandAndUpdateAffected(ctx, router.AccountID, snap, change)
|
||||
|
||||
return router, nil
|
||||
}
|
||||
@@ -256,7 +256,7 @@ func (m *managerImpl) DeleteRouter(ctx context.Context, accountID, userID, netwo
|
||||
|
||||
event()
|
||||
|
||||
go m.accountManager.ExpandAndUpdateAffected(ctx, accountID, snap, change)
|
||||
m.accountManager.ExpandAndUpdateAffected(ctx, accountID, snap, change)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user