Switch to JSON from EDN.

This commit is contained in:
John Wiseman 2020-05-25 17:52:39 -07:00
parent 4ee19d1a14
commit 2543fdc5e4
2 changed files with 3 additions and 2 deletions

View File

@ -9,5 +9,5 @@ sqb_path=/usr/local/share/advisorycircular/clean-basestation.sqb
config_path="$config_dir"/"$instance"-config.yaml
secrets_path="$config_dir"/"$instance"-secrets.yaml
history_path="$run_dir"/"$instance"-history.edn
history_path="$run_dir"/"$instance"-history.json
(cd "$run_dir" && "$dir"/intervalexec 10 node $dir/out/advisorycircular.js --config "$config_path" --secrets "$secrets_path" --basestation-sqb "$sqb_path" --history "$history_path" --log-prefix "$instance")

View File

@ -165,7 +165,8 @@
(defn read-history-db [path]
(p/let [json-str (util/read-file path {:encoding "utf-8"})
db (js->clj (.parse js/JSON json-str))]
db (js->clj (.parse js/JSON json-str) :keywordize-keys true)
db (into {} (map (fn [[k v]] [(name k) v]) db))]
(log-verbose "Loaded %s aircraft from database %s" (count db) path)
db))