Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis config fixes #19

Merged
merged 12 commits into from
Jan 28, 2025
Merged

Redis config fixes #19

merged 12 commits into from
Jan 28, 2025

Conversation

joodie
Copy link
Contributor

@joodie joodie commented Jan 22, 2025

No description provided.

@joodie joodie force-pushed the redis-config-fixes branch from fe9a088 to 2405c87 Compare January 22, 2025 09:33
- Pass redis connection info to goose client (producer) and worker (consumer)
- Ensure that worker is shut down correctly
@joodie joodie force-pushed the redis-config-fixes branch from c21b84a to fc75410 Compare January 22, 2025 10:16
@joodie joodie requested review from remvee and mdemare January 22, 2025 10:17
:body (json/write-str (assoc-in {} [:gateway :endpoints :google.com :responseCode] 200))})]
(response-match {:status 200 :body {:valid true}}
{:uri "/endpoints/google.com/config" :request-method :post})))
(is (= {:status 200 :body {:valid true}}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nl.jomco.http-status-codes/ok

{:uri "/endpoints/google.com/config" :request-method :post})))
(is (= {:status 200 :body {:valid true}}
(result "google.com"
{:status 200
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

(response-match {:status 200
:body {:valid false :message "Endpoint validation failed with status: 500"}}
{:uri "/endpoints/google.com/config" :request-method :post})))
(is (= {:status 200
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

(with-redefs [http/request (fn [_] {:status 500 :body {:message "mocked response"}})]
(response-match {:status 500 :body {}}
{:uri "/endpoints/google.com/config" :request-method :post})))
(is (= {:status 500 :body {}}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem. etc.

@@ -35,4 +35,4 @@
(catch Throwable e
(log/error e "Internal error in validator-service")
{:status http-status/internal-server-error
:body {}})))
:body {:error (ex-message e)}})))
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ik weet niet of dit een goed idee is. Gaat buitenstaanders niets aan wat er precies mis ging.

@@ -98,9 +99,34 @@
(wrap-json-response)
(wrap-defaults api-defaults))))

(defn error-message-from-response
[{:keys [status body]}]
(if (<= 400 status)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(when (or (http-status-codes/client-error-status? status)
          (http-status-codes/server-error-status? status))
           

[handler]
(fn [request]
(try (let [{:keys [status body] :as response} (handler request)]
(if (<= 500 status)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(http-status-codes/server-error-status? status)

@@ -101,7 +101,7 @@

(defn error-message-from-response
[{:keys [status body]}]
(if (<= 400 status)
(when (<= 400 status)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(when (or (http-status-codes/client-error-status? status)
          (http-status-codes/server-error-status? status))
           

@@ -0,0 +1,37 @@
(ns taoensso.encore
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ik begrijp niet wat dit is en waarvoor het is.

Makefile Show resolved Hide resolved
@joodie joodie force-pushed the redis-config-fixes branch 8 times, most recently from 0d900e8 to c7b54f6 Compare January 27, 2025 12:44
@joodie joodie requested a review from remvee January 28, 2025 08:28
Copy link

@remvee remvee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -23,6 +24,7 @@
(is (= http-status/ok status))
body))

;; TODO: Explain what this does and why
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a thread-safe mock implementation of a job queue. It will atomically return the top item on the queue and remove that item from the queue.

Copy link
Contributor

@mdemare mdemare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heb de TODO toegelicht. Ziet er verder goed uit.

@joodie joodie force-pushed the redis-config-fixes branch from c7cea4d to 5b8b782 Compare January 28, 2025 14:23
- Adds start! and stop! functions for whole system
- Set application log level to DEBUG when REPL is started
- Fix jetty lifecycle handling when app is restarted in repl
@joodie joodie force-pushed the redis-config-fixes branch from 5b8b782 to 85e0c80 Compare January 28, 2025 14:24
@joodie joodie merged commit fba450e into main Jan 28, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants