This is an automated email from the ASF dual-hosted git repository.

tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git


The following commit(s) were added to refs/heads/master by this push:
     new a3e8124  mongo listwatch bug fix (#848)
a3e8124 is described below

commit a3e8124e57ff2f6b1c9001e27521008a39ecbc7e
Author: fuziye01 <[email protected]>
AuthorDate: Sun Feb 7 17:30:52 2021 +0800

    mongo listwatch bug fix (#848)
---
 datasource/mongo/sd/mongo_cacher.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/datasource/mongo/sd/mongo_cacher.go 
b/datasource/mongo/sd/mongo_cacher.go
index 16cf67b..fc4273d 100644
--- a/datasource/mongo/sd/mongo_cacher.go
+++ b/datasource/mongo/sd/mongo_cacher.go
@@ -448,6 +448,10 @@ func (c *MongoCacher) notify(evts []MongoEvent) {
        defer log.Recover()
 
        for _, evt := range evts {
+               if evt.Type == rmodel.EVT_DELETE && evt.Value == nil {
+                       log.Warn(fmt.Sprintf("caught delete event:%s, but value 
can't get from caches, it may be deleted by last list", evt.ResourceID))
+                       continue
+               }
                eventProxy.OnEvent(evt)
        }
 }

Reply via email to