diff options
author | Robin Jarry <robin@jarry.cc> | 2023-06-29 16:53:38 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-08-04 11:32:40 +0200 |
commit | a3e811e00d8a7fe0f37d85557d7db60087967171 (patch) | |
tree | fc5e3e35487499e9b78a3f4f875f8bfb8f807526 /worker/maildir | |
parent | d29c9d1a2ff82234ad1810abc6a57199340e7fd5 (diff) | |
download | aerc-a3e811e00d8a7fe0f37d85557d7db60087967171.tar.gz |
watchers: move filesystem monitoring stuff in lib
No functional change. This will allow reuse in other parts of aerc.
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Koni Marti <koni.marti@gmail.com>
Diffstat (limited to 'worker/maildir')
-rw-r--r-- | worker/maildir/worker.go | 7 |
1 files changed, 4 insertions, 3 deletions
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) } |