diff --git a/CHANGELOG.md b/CHANGELOG.md index 884c5e8..bf2cf40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ For a list of breaking changes, check [here](#breaking-changes). ## Unreleased +- Fixed flushing behaviour when consuming from STDIN in the ruby-percolator example. - `LMGREP_FEATURE_EPSILON_GC`: use [Epsilon GC](https://www.graalvm.org/22.0/reference-manual/native-image/MemoryManagement/) in the binary. ## v2022.02.17 diff --git a/src/lmgrep/only_analyze.clj b/src/lmgrep/only_analyze.clj index cb988bf..7fe3a0e 100644 --- a/src/lmgrep/only_analyze.clj +++ b/src/lmgrep/only_analyze.clj @@ -107,7 +107,8 @@ [nil]) custom-analyzers (analysis/prepare-analyzers (get options :analyzers-file) options) ^Analyzer analyzer (analyzer/create analysis-conf custom-analyzers) - ^PrintWriter writer (PrintWriter. (BufferedWriter. *out* print-writer-buffer-size))] + ^PrintWriter writer (PrintWriter. (BufferedWriter. *out* print-writer-buffer-size) + ^Boolean (empty? files-pattern))] (if (get options :graph) (graph files-to-analyze writer analyzer options) (execute-analysis files-to-analyze writer analyzer options)))) diff --git a/src/lmgrep/unordered.clj b/src/lmgrep/unordered.clj index ad39a19..6e2e1f0 100644 --- a/src/lmgrep/unordered.clj +++ b/src/lmgrep/unordered.clj @@ -59,7 +59,8 @@ queue-size (get options :queue-size 1024) with-empty-lines (get options :with-empty-lines) consume-fn (if preserve-order? ordered-consume-reader unordered-consume-reader) - ^PrintWriter writer (PrintWriter. (BufferedWriter. *out* print-writer-buffer-size)) + ^PrintWriter writer (PrintWriter. (BufferedWriter. *out* print-writer-buffer-size) + ^Boolean (empty? file-paths-to-analyze)) ^ExecutorService matcher-thread-pool-executor (c/thread-pool-executor concurrency queue-size) ^ExecutorService writer-thread-pool-executor (c/single-thread-executor)] (doseq [^String path (if (empty? file-paths-to-analyze)