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 18, 2024
1 parent 6437286 commit 313224e
Show file tree
Hide file tree
Showing 3 changed files with 6 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))
1 change: 1 addition & 0 deletions test/nl/surf/eduhub_rio_mapper/e2e_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
(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."
(let [job (post-job :dry-run/upsert :education-specifications "parent-program")]
(is (= {} environ.core/env))
(is (job-done? job))
(is (job-dry-run-not-found? job))))

Expand Down

0 comments on commit 313224e

Please sign in to comment.