Skip to content

Commit 12796cb

Browse files
committed
fix: adjust chan size try to avoid fs event drop
Signed-off-by: black-desk <me@black-desk.cn>
1 parent e2cd9aa commit 12796cb

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/cgfsmon/new.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ func New(opts ...Opt) (ret *CGroupFSMonitor, err error) {
2222

2323
w := &CGroupFSMonitor{}
2424

25-
w.eventsOut = make(chan types.CGroupEvents, 1)
26-
w.eventsIn = make(chan notify.EventInfo, 1)
25+
w.eventsOut = make(chan types.CGroupEvents)
26+
27+
// FIXME:
28+
// github.com/rjeczalik/notify drop events if receiver is too slow.
29+
// https://github.com/rjeczalik/notify/issues/85
30+
// https://github.com/rjeczalik/notify/issues/98
31+
w.eventsIn = make(chan notify.EventInfo, 20)
2732

2833
for i := range opts {
2934
w, err = opts[i](w)

0 commit comments

Comments
 (0)