Skip to content
This repository was archived by the owner on Jun 11, 2023. It is now read-only.

Commit 74edf57

Browse files
author
Oleg Noga
committed
name required, as in docs, get-host-ip made public as it can be part of id
1 parent 1cf4b69 commit 74edf57

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/consul/agent.clj

+5-5
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
(default-callback response))))))
7474

7575

76-
(defn- get-host-ip []
76+
(defn get-host-ip []
7777
(try
7878
(let [consul-url (URL. *consul-url*)]
7979
(-> (doto (DatagramSocket.)
@@ -86,19 +86,19 @@
8686

8787

8888
(defn- register-request [{:keys [id name address port ttl deregister-critical-service-after]}]
89-
{:id id
90-
:name (or name id)
89+
{:name name
90+
:id (or id name)
9191
:address (or address (get-host-ip))
9292
:port port
93-
:check {:CheckId (str id ":ttl-check")
93+
:check {:CheckId (str id "/ttl-check")
9494
:TTL ttl
9595
:DeregisterCriticalServiceAfter deregister-critical-service-after}})
9696

9797

9898
(defn heartbeat
9999
"single heartbeat"
100100
[params]
101-
(check-update-with-register (str (:id params) ":ttl-check")
101+
(check-update-with-register (str (:id params) "/ttl-check")
102102
:passing
103103
(register-request params)))
104104

0 commit comments

Comments
 (0)