summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-03-10 09:36:55 +0800
committereltrac <hi@eltr.ac>2026-03-10 09:36:55 +0800
commit14c3fe33f59089af1ff89ee931ff6e9338c7f801 (patch)
tree25cde4d77bc9c147899fca714b5b1d5141f22c1e /src
parent0d0002599dd50c4bed0f7cfc1076ad52917631a8 (diff)
fix(storage): unload data in lines instead of all in one line
Diffstat (limited to 'src')
-rw-r--r--src/weepinbell/storage.clj6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/weepinbell/storage.clj b/src/weepinbell/storage.clj
index f0b805b..46222de 100644
--- a/src/weepinbell/storage.clj
+++ b/src/weepinbell/storage.clj
@@ -1,7 +1,8 @@
(ns weepinbell.storage
(:require [clojure.edn :as edn]
[weepinbell.config :refer [get-config]]
- [clojure.java.io :as io]))
+ [clojure.java.io :as io]
+ [clojure.string :refer [join]]))
(def data-file (get-config :data-path))
@@ -15,7 +16,8 @@
(defn unload-data
"Write to data file, replacing everything."
[data]
- (spit data-file (pr-str data)))
+ (when-let [data-with-string (map pr-str data)]
+ (spit data-file (join "\n" data-with-string))))
(defn get-wm
"Get an existing Webmention by source and target."