mirror of https://github.com/status-im/go-waku.git
chore: stop light filter node by default (#964)
This commit is contained in:
parent
5e3c9fdfa1
commit
b4ba7b75d4
|
@ -529,6 +529,7 @@ func (w *WakuNode) Stop() {
|
|||
w.store.Stop()
|
||||
w.legacyFilter.Stop()
|
||||
w.filterFullNode.Stop()
|
||||
w.filterLightNode.Stop()
|
||||
|
||||
if w.opts.enableDiscV5 {
|
||||
w.discoveryV5.Stop()
|
||||
|
|
|
@ -112,6 +112,10 @@ func (wf *WakuFilterLightNode) Stop() {
|
|||
wf.CommonService.Stop(func() {
|
||||
wf.h.RemoveStreamHandler(FilterPushID_v20beta1)
|
||||
if wf.subscriptions.Count() > 0 {
|
||||
go func() {
|
||||
defer func() {
|
||||
_ = recover()
|
||||
}()
|
||||
res, err := wf.unsubscribeAll(wf.Context())
|
||||
if err != nil {
|
||||
wf.log.Warn("unsubscribing from full nodes", zap.Error(err))
|
||||
|
@ -123,8 +127,8 @@ func (wf *WakuFilterLightNode) Stop() {
|
|||
}
|
||||
|
||||
}
|
||||
//
|
||||
wf.subscriptions.Clear()
|
||||
}()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -617,6 +621,7 @@ func (wf *WakuFilterLightNode) unsubscribeAll(ctx context.Context, opts ...Filte
|
|||
if params.wg != nil {
|
||||
params.wg.Done()
|
||||
}
|
||||
_ = recover()
|
||||
}()
|
||||
|
||||
paramsCopy := params.Copy()
|
||||
|
|
Loading…
Reference in New Issue