refactor(core): make watcher subscription effectful
This commit is contained in:
parent
fc11ed3838
commit
bd906d468d
5 changed files with 49 additions and 34 deletions
|
|
@ -253,7 +253,8 @@ const layer = Layer.effect(
|
|||
// inside), so don't watch what can't trigger anything.
|
||||
if (yield* fs.isDir(operation.target)) continue
|
||||
watched.add(operation.target)
|
||||
yield* watcher.subscribe({ path: operation.target, type: "file" }).pipe(
|
||||
const updates = yield* watcher.subscribe({ path: operation.target, type: "file" })
|
||||
yield* updates.pipe(
|
||||
Stream.runForEach(() => PubSub.publish(configuredChanges, undefined)),
|
||||
Effect.catchCause((cause) =>
|
||||
Effect.logError("configured plugin watch failed", { target: operation.target, cause }),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue