Skip to content

Commit 51506cd

Browse files
committed
fix: clear data after disconnected
1 parent 7dd65dd commit 51506cd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

backend/graph/fetch/gobgpwatch/gobgpwatch.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,14 @@ func (f *GoBGPWatch) Run() {
120120
if errors.Is(err, context.Canceled) {
121121
return
122122
}
123+
123124
log.Println("watch err:", err)
125+
126+
// clear data
127+
f.lock.Lock()
128+
f.paths = nil
129+
f.lock.Unlock()
130+
124131
// wait and retry
125132
time.Sleep(time.Second)
126133
continue

0 commit comments

Comments
 (0)