diff options
| author | eltrac <hi@eltr.ac> | 2026-03-10 09:21:01 +0800 |
|---|---|---|
| committer | eltrac <hi@eltr.ac> | 2026-03-10 09:21:01 +0800 |
| commit | dd6d665b7b01b6c830b47bc1a5b17995ea470888 (patch) | |
| tree | c1380434539b6314be259c1628611c04ffd62079 | |
| parent | 43746e85abeea83c50de78632c3334d77f099832 (diff) | |
fix(storage): load data into a vector
| -rw-r--r-- | src/weepinbell/storage.clj | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/weepinbell/storage.clj b/src/weepinbell/storage.clj index 491d7e3..2bbcf70 100644 --- a/src/weepinbell/storage.clj +++ b/src/weepinbell/storage.clj @@ -8,7 +8,9 @@ (defn load-data "Read data file and return data as clojure data sturcture, a vector containing Webmention maps in this case." [] - (-> data-file slurp edn/read-string)) + (with-open [r (io/reader data-file)] + (let [string-vector (-> r line-seq vec)] + (vec (map edn/read-string string-vector))))) (defn unload-data "Write to data file, replacing everything." |
