From 20f357d75d1ada9b58924f795e0f858bb2987c54 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 14 Jun 2022 12:12:53 +0200 Subject: [PATCH] :sparkles: Make the region param optional on s3 storage backend Defaulting to the eu-central-1 --- backend/src/app/storage/s3.clj | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/src/app/storage/s3.clj b/backend/src/app/storage/s3.clj index 9c2129638..c5c4a6819 100644 --- a/backend/src/app/storage/s3.clj +++ b/backend/src/app/storage/s3.clj @@ -59,7 +59,7 @@ ;; --- BACKEND INIT -(s/def ::region #{:eu-central-1}) +(s/def ::region ::us/keyword) (s/def ::bucket ::us/string) (s/def ::prefix ::us/string) (s/def ::endpoint ::us/string) @@ -68,9 +68,10 @@ (s/keys :opt-un [::region ::bucket ::prefix ::endpoint ::wrk/executor])) (defmethod ig/prep-key ::backend - [_ {:keys [prefix] :as cfg}] + [_ {:keys [prefix region] :as cfg}] (cond-> (d/without-nils cfg) - prefix (assoc :prefix prefix))) + (some? prefix) (assoc :prefix prefix) + (nil? region) (assoc :region :eu-central-1))) (defmethod ig/init-key ::backend [_ cfg]