Skip to content

Commit

Permalink
feat: ensure xtdb is warm before starting the server
Browse files Browse the repository at this point in the history
  • Loading branch information
Akeboshiwind committed Mar 8, 2024
1 parent 9c2df4c commit 19891fb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server.clj
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@

(defn start
[{:keys [join port] :or {port 8000}}]
; NOTE: This ensure xtdb is warmed up before starting the server
; Otherwise, the first few requests will fail
(with-open [node (xtn/start-node {})]
(xt/status node))
(let [server (jetty/run-jetty (ring/ring-handler
(router)
(ring/routes
Expand Down

0 comments on commit 19891fb

Please sign in to comment.