Skip to content

Commit

Permalink
Log port when starting api; don't allow default worker port
Browse files Browse the repository at this point in the history
  • Loading branch information
mdemare committed Sep 19, 2024
1 parent 6437286 commit e31cfd8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/nl/surf/eduhub_rio_mapper/endpoints/api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
(ns nl.surf.eduhub-rio-mapper.endpoints.api
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]
[clojure.tools.logging :as log]
[compojure.core :refer [GET POST]]
[compojure.route :as route]
[nl.jomco.http-status-codes :as http-status]
Expand Down Expand Up @@ -250,5 +251,6 @@

(defn serve-api
[{{:keys [^Integer port host]} :api-config :as config}]
(log/info (str "Starting api on port " port))
(.addShutdownHook (Runtime/getRuntime) (new Thread ^Runnable shutdown-handler))
(app-server/run-jetty (make-app config) host port))
4 changes: 3 additions & 1 deletion src/nl/surf/eduhub_rio_mapper/endpoints/worker_api.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
;; <https://www.gnu.org/licenses/>.

(ns nl.surf.eduhub-rio-mapper.endpoints.worker-api
(:require [compojure.core :refer [GET]]
(:require [clojure.tools.logging :as log]
[compojure.core :refer [GET]]
[compojure.route :as route]
[nl.jomco.ring-trace-context :refer [wrap-trace-context]]
[nl.surf.eduhub-rio-mapper.endpoints.app-server :as app-server]
Expand Down Expand Up @@ -47,4 +48,5 @@

(defn serve-api
[{{:keys [^Integer port host]} :worker-api-config :as config}]
(log/info (str "Starting worker api on port " port))
(app-server/run-jetty (make-app config) host port))
6 changes: 6 additions & 0 deletions test/nl/surf/eduhub_rio_mapper/e2e_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@

(use-fixtures :once with-running-mapper remote-entities-fixture)

(deftest ^:e2e test-env-variables
(let [worker-api-port (System/getenv "WORKER_API_PORT")]
(if (nil? worker-api-port)
(println "WORKER_API_PORT is not set")
(println "WORKER_API_PORT is set to" worker-api-port))))

(deftest ^:e2e create-edspecs-and-program
(testing "create edspecs"
(testing "scenario [1a]: Test /job/dry-run to see the difference between the edspec parent in OOAPI en de opleidingeenheid in RIO. You can expect RIO to be empty, when you start fresh."
Expand Down

0 comments on commit e31cfd8

Please sign in to comment.