mirror of
https://github.com/edufeed-org/typesense-indexer.git
synced 2025-12-10 00:34:36 +00:00
add config
This commit is contained in:
parent
022313ccc3
commit
35a032f235
4 changed files with 20 additions and 6 deletions
3
README.md
Normal file
3
README.md
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
# Typesense Indexer
|
||||
|
||||
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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))))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue