add config

This commit is contained in:
@s.roertgen 2024-12-16 13:16:31 +01:00
parent 022313ccc3
commit 35a032f235
4 changed files with 20 additions and 6 deletions

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# Typesense Indexer

View file

@ -57,8 +57,8 @@
(reconnect status)))))]
(try
(let [wc (create-websocket url reconnect last-parsed-event newest-event)]
(assoc component :connection wc)
(init-request-30142 wc last-parsed-event newest-event "init"))
(init-request-30142 wc last-parsed-event newest-event "init")
(assoc component :connection wc))
(catch Exception e
(println "Failed to start connection for " url)

View file

@ -4,11 +4,11 @@
[com.stuartsierra.component :as component]
))
(defn main []
(component/start (system/system))
(defn -main []
(component/start (system/new-system))
)
(comment
(component/stop (system/system))
(component/stop (system/new-system))
)

View file

@ -3,8 +3,19 @@
[typesense-indexer.components.websocket :as ws]
[typesense-indexer.components.typesense :as typesense]))
(defn system []
(defn new-system-map []
(component/system-map
:typesense (typesense/new-typesense-component)
:websocket (component/using (ws/new-websocket-connection "ws://localhost:7778")
[:typesense])))
(defn new-dependency-map [] {})
(defn new-system
"Create the production system"
[]
(println ";; Setting up new system")
(-> (new-system-map)
(component/system-using (new-dependency-map))))