Skip to content

Commit

Permalink
Ensure query input stream is closed when spilling subject URIs to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
Robsteranium committed May 17, 2021
1 parent c171e19 commit 57dc5a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ook/etl.clj
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@
(try
;; write results to tempfile cache
(let [client (interceptors/accept client "text/csv")]
(with-open [os (io/output-stream cache-file)]
(io/copy (io/input-stream (query client query-string)) os)))
(with-open [cache (io/output-stream cache-file)
result (io/input-stream (query client query-string))]
(io/copy result cache)))
;; read results from tempfile cache
(let [rdr (io/reader cache-file)
var-name (.readLine rdr)
Expand Down

0 comments on commit 57dc5a9

Please sign in to comment.