Skip to content

Commit 804f8a5

Browse files
committed
lint fix
Signed-off-by: Angelo De Caro <adc@zurich.ibm.com>
1 parent 520788f commit 804f8a5

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

token/services/network/fabricx/lookup/gocron.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ func (n *CronListenerManager) AddLookupListener(namespace string, key string, li
118118
logger.Debugf("[KeyCheck] key [%s:%s] found, notify listener", namespace, key)
119119
listener.OnStatus(context.Background(), key, v.Raw)
120120

121-
// Stop the job
122-
n.RemoveLookupListener(key, listener)
121+
// Stop the job, no error is expected here
122+
_ = n.RemoveLookupListener(key, listener)
123123

124124
return
125125
}
@@ -128,8 +128,8 @@ func (n *CronListenerManager) AddLookupListener(namespace string, key string, li
128128
logger.Debugf("[KeyCheck] key [%s:%s] not found, deadline reached", namespace, key)
129129
listener.OnError(context.Background(), key, errors.Errorf("key [%s:%s] not found", namespace, key))
130130

131-
// Stop the job
132-
n.RemoveLookupListener(key, listener)
131+
// Stop the job, no error is expected here
132+
_ = n.RemoveLookupListener(key, listener)
133133

134134
return
135135
}

token/services/network/fabricx/lookup/gocron_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ func TestCronListenerManager(t *testing.T) {
3838

3939
mgr, err := lookup.NewCronListenerManager(qs, config)
4040
require.NoError(t, err)
41-
defer mgr.Stop()
41+
defer func() {
42+
_ = mgr.Stop()
43+
}()
4244

4345
assert.True(t, mgr.PermanentLookupListenerSupported())
4446

@@ -118,8 +120,8 @@ func TestCronNSListenerManagerProvider(t *testing.T) {
118120
mgr, err := p.NewManager("network", "channel")
119121
require.NoError(t, err)
120122
assert.NotNil(t, mgr)
121-
123+
122124
cronMgr, ok := mgr.(*lookup.CronListenerManager)
123125
assert.True(t, ok)
124-
cronMgr.Stop()
126+
require.NoError(t, cronMgr.Stop())
125127
}

0 commit comments

Comments
 (0)