From a3e811e00d8a7fe0f37d85557d7db60087967171 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Thu, 29 Jun 2023 16:53:38 +0200 Subject: watchers: move filesystem monitoring stuff in lib No functional change. This will allow reuse in other parts of aerc. Signed-off-by: Robin Jarry Tested-by: Koni Marti --- worker/maildir/worker.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'worker/maildir/worker.go') diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go index 7e75a8ca..e8da6fbd 100644 --- a/worker/maildir/worker.go +++ b/worker/maildir/worker.go @@ -22,6 +22,7 @@ import ( aercLib "git.sr.ht/~rjarry/aerc/lib" "git.sr.ht/~rjarry/aerc/lib/iterator" + "git.sr.ht/~rjarry/aerc/lib/watchers" "git.sr.ht/~rjarry/aerc/log" "git.sr.ht/~rjarry/aerc/models" "git.sr.ht/~rjarry/aerc/worker/handlers" @@ -44,7 +45,7 @@ type Worker struct { selectedName string selectedInfo *models.DirectoryInfo worker types.WorkerInteractor - watcher types.FSWatcher + watcher watchers.FSWatcher watcherDebounce *time.Timer fsEvents chan struct{} currentSortCriteria []*types.SortCriterion @@ -56,7 +57,7 @@ type Worker struct { // NewWorker creates a new maildir worker with the provided worker. func NewWorker(worker *types.Worker) (types.Backend, error) { - watch, err := handlers.NewWatcher() + watch, err := watchers.NewWatcher() if err != nil { return nil, fmt.Errorf("could not create file system watcher: %w", err) } @@ -73,7 +74,7 @@ func NewWorker(worker *types.Worker) (types.Backend, error) { // NewMaildirppWorker creates a new Maildir++ worker with the provided worker. func NewMaildirppWorker(worker *types.Worker) (types.Backend, error) { - watch, err := handlers.NewWatcher() + watch, err := watchers.NewWatcher() if err != nil { return nil, fmt.Errorf("could not create file system watcher: %w", err) } -- cgit