Skip to content

Commit

Permalink
fix: adjust chan size try to avoid fs event drop
Browse files Browse the repository at this point in the history
Signed-off-by: black-desk <me@black-desk.cn>
  • Loading branch information
black-desk committed Feb 29, 2024
1 parent e2cd9aa commit 12796cb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/cgfsmon/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ func New(opts ...Opt) (ret *CGroupFSMonitor, err error) {

w := &CGroupFSMonitor{}

w.eventsOut = make(chan types.CGroupEvents, 1)
w.eventsIn = make(chan notify.EventInfo, 1)
w.eventsOut = make(chan types.CGroupEvents)

// FIXME:
// github.com/rjeczalik/notify drop events if receiver is too slow.
// https://github.com/rjeczalik/notify/issues/85
// https://github.com/rjeczalik/notify/issues/98
w.eventsIn = make(chan notify.EventInfo, 20)

for i := range opts {
w, err = opts[i](w)
Expand Down

0 comments on commit 12796cb

Please sign in to comment.