Implement CaseSensitiveQuery #39
4 changed files with 13 additions and 3 deletions
|
@ -78,6 +78,8 @@
|
|||
boards))))
|
||||
|
||||
(defn config-fill-board-defaults
|
||||
;; TODO: must have check that if board is default, it's enabled, if it's not, give some big fat warning
|
||||
;; that users must always specify board, maybe change the error?
|
||||
"Fills every enabled board with default config values"
|
||||
[config]
|
||||
(let [defaults (:boards-defaults config)]
|
||||
|
|
|
@ -72,6 +72,7 @@
|
|||
(let [config (conf/get-some-config (:config options))]
|
||||
;; TODO: probably refactor to use separate config.clj file when validation will be added
|
||||
;; Init the few globals we have
|
||||
;; TODO: this all needs to go in separate function so it doesnt have to duplicated in repl-main
|
||||
(reset! conf/GLOBAL-CONFIG config)
|
||||
(reset! feed/boards-enabled-cache (set (keys (get config :boards-enabled))))
|
||||
(reset! watcher/chod-threads-cache (watcher/generate-chod-cache-structure config))
|
||||
|
@ -83,6 +84,12 @@
|
|||
(defn repl-main
|
||||
"Development entry point"
|
||||
[]
|
||||
(let [config (conf/get-some-config nil)]
|
||||
;; TODO: probably refactor to use separate config.clj file when validation will be added
|
||||
;; Init the few globals we have
|
||||
(reset! conf/GLOBAL-CONFIG config)
|
||||
(reset! feed/boards-enabled-cache (set (keys (get config :boards-enabled))))
|
||||
(reset! watcher/chod-threads-cache (watcher/generate-chod-cache-structure config)))
|
||||
(jetty/run-jetty (rp/wrap-params #'feed/http-handler)
|
||||
{:port (:port conf/CONFIG-DEFAULT)
|
||||
;; Dont block REPL thread
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
This is done by always making new GUID - (concat thread-number UNIX-time-of-data-update)"
|
||||
[thread time]
|
||||
(assoc thread :guid (str (:no thread)
|
||||
"-"
|
||||
time)))
|
||||
"-"
|
||||
time)))
|
||||
|
||||
(defn new-guid-paranoid
|
||||
"Generate unique GUID on EVERY request to the feed.
|
||||
|
@ -79,7 +79,7 @@
|
|||
"true" (fn [x] (new-guid-always x time-of-generation))
|
||||
update-only-guid)
|
||||
cache-start-index (first (ut/indices (fn [x] (>= (:chod x) chod-treshold))
|
||||
cache))
|
||||
cache))
|
||||
;; So we don't have to search thru everything we have cached
|
||||
needed-cache-part (subvec cache cache-start-index)
|
||||
;; Here we gonna run fmap but not really
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
{k (map-apply-defaults conf-val default-val)}
|
||||
{k (nil?-else conf-val default-val)})))))
|
||||
|
||||
;; This is a shitty version of reduce-kv
|
||||
(defn fmap
|
||||
"Applies function [f] to every key and value in map [m]
|
||||
Function signature should be (f [key value]).
|
||||
|
|
Loading…
Reference in a new issue