Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PapaCharlie committed Feb 7, 2025
1 parent 33fc4b6 commit d524e22
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions internal/server/subscription_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,7 @@ func (c *subscriptionManagerCore) UnsubscribeAll() {
}

func (c *subscriptionManagerCore) subscribe(name string) {
unsub, ok := c.subscriptions[name]
if ok {
unsub()
}
c.unsubscribe(name)
c.subscriptions[name] = c.locator.Subscribe(c.ctx, c.typeURL, name, c.handler)
}

Expand Down
6 changes: 3 additions & 3 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -661,10 +661,10 @@ func TestImplicitWildcardSubscription(t *testing.T) {
h := NewNoopBatchSubscriptionHandler(t)
typeURL := TypeOf[*ads.Secret]().URL()

newMockLocator := func(t *testing.T) (rs mockResourceLocator, wildcardSub, fooSub chan struct{}) {
newMockLocator := func(t *testing.T) (l mockResourceLocator, wildcardSub, fooSub chan struct{}) {
wildcardSub = make(chan struct{}, 1)
fooSub = make(chan struct{}, 1)
rs = func(actualTypeURL, resourceName string) func() {
l = func(actualTypeURL, resourceName string) func() {
require.Equal(t, typeURL, actualTypeURL)
switch resourceName {
case ads.WildcardSubscription:
Expand All @@ -682,7 +682,7 @@ func TestImplicitWildcardSubscription(t *testing.T) {
return nil
}
}
return rs, wildcardSub, fooSub
return l, wildcardSub, fooSub
}
requireSelect := func(t *testing.T, ch <-chan struct{}, shouldBeClosed bool) {
t.Helper()
Expand Down

0 comments on commit d524e22

Please sign in to comment.