浏览代码

first watch action for a file event wins

Signed-off-by: Nicolas De Loof <[email protected]>
Nicolas De Loof 1 年之前
父节点
当前提交
254224c182
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      pkg/compose/watch.go

+ 4 - 1
pkg/compose/watch.go

@@ -371,7 +371,10 @@ func batchDebounceEvents(ctx context.Context, clock clockwork.Clock, delay time.
 					flushEvents()
 					return
 				}
-				seen[e.HostPath] = e
+				if _, ok := seen[e.HostPath]; !ok {
+					// already know updated path, first rule in watch configuration wins
+					seen[e.HostPath] = e
+				}
 				t.Reset(delay)
 			}
 		}