Skip to content

Commit

Permalink
Move f to top let
Browse files Browse the repository at this point in the history
Just a simple refactoring.
  • Loading branch information
ogf committed Jun 14, 2014
1 parent 0f53f6b commit 1a68536
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/juxt/dirwatch.clj
Expand Up @@ -86,15 +86,15 @@
systems. The watcher returned by this function is a resource which
should be closed with close-watcher."
[f & files]
(let [ws (.newWatchService (FileSystems/getDefault))]
(let [ws (.newWatchService (FileSystems/getDefault))
f (continue-on-exception f)]
(doseq [file files :when (.exists file)] (register-path ws (. file toPath)))
(let [f (continue-on-exception f)]
(send-off (agent ws
:meta {::watcher true}
:error-handler (fn [ag ex]
(.printStackTrace ex)
(send-off ag wait-for-events f)))
wait-for-events f))))
(send-off (agent ws
:meta {::watcher true}
:error-handler (fn [ag ex]
(.printStackTrace ex)
(send-off ag wait-for-events f)))
wait-for-events f)))

(defn close-watcher
"Close an existing watcher and free up it's resources."
Expand Down

0 comments on commit 1a68536

Please sign in to comment.