Skip to content

Commit 0b16448

Browse files
committed
s/ErrWatcherClosed/ErrClosed/g
1 parent 5a96a55 commit 0b16448

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

agent/agentcontainers/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ func (api *API) start() {
152152
for {
153153
event, err := api.watcher.Next(api.ctx)
154154
if err != nil {
155-
if errors.Is(err, watcher.ErrWatcherClosed) {
155+
if errors.Is(err, watcher.ErrClosed) {
156156
api.logger.Debug(api.ctx, "watcher closed")
157157
return
158158
}

agent/agentcontainers/watcher/noop.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ func (n *noopWatcher) Next(ctx context.Context) (*fsnotify.Event, error) {
3232
case <-ctx.Done():
3333
return nil, ctx.Err()
3434
case <-n.done:
35-
return nil, ErrWatcherClosed
35+
return nil, ErrClosed
3636
}
3737
}
3838

3939
func (n *noopWatcher) Close() error {
4040
n.mu.Lock()
4141
defer n.mu.Unlock()
4242
if n.closed {
43-
return ErrWatcherClosed
43+
return ErrClosed
4444
}
4545
n.closed = true
4646
close(n.done)

agent/agentcontainers/watcher/watcher.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
"golang.org/x/xerrors"
1616
)
1717

18-
var ErrWatcherClosed = xerrors.New("watcher closed")
18+
var ErrClosed = xerrors.New("watcher closed")
1919

2020
// Watcher defines an interface for monitoring file system changes.
2121
// Implementations track file modifications and provide an event stream
@@ -140,7 +140,7 @@ func (f *fsnotifyWatcher) Next(ctx context.Context) (event *fsnotify.Event, err
140140
return nil, ctx.Err()
141141
case evt, ok := <-f.Events:
142142
if !ok {
143-
return nil, ErrWatcherClosed
143+
return nil, ErrClosed
144144
}
145145

146146
// Get the absolute path to match against our watched files.
@@ -160,11 +160,11 @@ func (f *fsnotifyWatcher) Next(ctx context.Context) (event *fsnotify.Event, err
160160

161161
case err, ok := <-f.Errors:
162162
if !ok {
163-
return nil, ErrWatcherClosed
163+
return nil, ErrClosed
164164
}
165165
return nil, xerrors.Errorf("watcher error: %w", err)
166166
case <-f.done:
167-
return nil, ErrWatcherClosed
167+
return nil, ErrClosed
168168
}
169169
}
170170
}
@@ -178,7 +178,7 @@ func (f *fsnotifyWatcher) Close() (err error) {
178178
f.mu.Unlock()
179179

180180
if closed {
181-
return ErrWatcherClosed
181+
return ErrClosed
182182
}
183183

184184
close(f.done)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy