Permalink
Browse files

close writer when done

  • Loading branch information...
1 parent f1c2d23 commit e2ef6a86c18eeef5338131909c1e4d2de6422128 @nakkaya committed Aug 18, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/inbox_feed/core.clj
View
@@ -246,9 +246,11 @@
(defn atomic-dump [_ obj feed-data]
(try
(let [data-file (File. feed-data)
- tmp-file (File. (str feed-data ".tmp"))]
- (binding [*out* (java.io.FileWriter. tmp-file)]
+ tmp-file (File. (str feed-data ".tmp"))
+ writer (java.io.FileWriter. tmp-file)]
+ (binding [*out* writer]
(prn obj))
+ (.close writer)
(.renameTo tmp-file data-file))
true
(catch Exception e

0 comments on commit e2ef6a8

Please sign in to comment.