mirror of
https://github.com/penpot/penpot.git
synced 2025-07-14 15:07:37 +02:00
✨ Fix all linter issues on backend code.
This commit is contained in:
parent
6dafc087e9
commit
b80295a21c
48 changed files with 134 additions and 256 deletions
|
@ -9,21 +9,13 @@
|
|||
|
||||
(ns app.storage.db
|
||||
(:require
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.storage.impl :as impl]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.spec.alpha :as s]
|
||||
[datoteka.core :as fs]
|
||||
[lambdaisland.uri :as u]
|
||||
[integrant.core :as ig])
|
||||
(:import
|
||||
org.postgresql.largeobject.LargeObject
|
||||
java.io.ByteArrayInputStream
|
||||
java.io.ByteArrayOutputStream
|
||||
java.io.InputStream
|
||||
java.io.OutputStream))
|
||||
java.io.ByteArrayInputStream))
|
||||
|
||||
;; --- BACKEND INIT
|
||||
|
||||
|
@ -58,11 +50,11 @@
|
|||
(ByteArrayInputStream. (:data result))))
|
||||
|
||||
(defmethod impl/get-object-url :db
|
||||
[backend {:keys [id] :as object}]
|
||||
[_ _]
|
||||
(throw (UnsupportedOperationException. "not supported")))
|
||||
|
||||
(defmethod impl/del-objects-in-bulk :db
|
||||
[backend ids]
|
||||
;; NOOP: because delting the row already deletes the file data from
|
||||
[_ _]
|
||||
;; NOOP: because deleting the row already deletes the file data from
|
||||
;; the database.
|
||||
nil)
|
||||
|
|
|
@ -9,17 +9,15 @@
|
|||
|
||||
(ns app.storage.fs
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.storage.impl :as impl]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.spec.alpha :as s]
|
||||
[datoteka.core :as fs]
|
||||
[cuerdas.core :as str]
|
||||
[lambdaisland.uri :as u]
|
||||
[integrant.core :as ig])
|
||||
[datoteka.core :as fs]
|
||||
[integrant.core :as ig]
|
||||
[lambdaisland.uri :as u])
|
||||
(:import
|
||||
java.io.InputStream
|
||||
java.io.OutputStream
|
||||
|
@ -34,7 +32,7 @@
|
|||
(s/keys :opt-un [::directory]))
|
||||
|
||||
(defmethod ig/init-key ::backend
|
||||
[key cfg]
|
||||
[_ cfg]
|
||||
;; Return a valid backend data structure only if all optional
|
||||
;; parameters are provided.
|
||||
(when (string? (:directory cfg))
|
||||
|
|
|
@ -13,14 +13,13 @@
|
|||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.common.uuid :as uuid]
|
||||
[clojure.java.io :as io]
|
||||
[buddy.core.codecs :as bc])
|
||||
[buddy.core.codecs :as bc]
|
||||
[clojure.java.io :as io])
|
||||
(:import
|
||||
java.nio.ByteBuffer
|
||||
java.util.UUID
|
||||
java.io.ByteArrayInputStream
|
||||
java.io.InputStream
|
||||
java.nio.file.Path
|
||||
java.nio.file.Files))
|
||||
|
||||
;; --- API Definition
|
||||
|
|
|
@ -13,23 +13,18 @@
|
|||
[app.common.data :as d]
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.spec :as us]
|
||||
[app.db :as db]
|
||||
[app.storage.impl :as impl]
|
||||
[app.util.time :as dt]
|
||||
[clojure.java.io :as io]
|
||||
[clojure.spec.alpha :as s]
|
||||
[lambdaisland.uri :as u]
|
||||
[integrant.core :as ig])
|
||||
[integrant.core :as ig]
|
||||
[lambdaisland.uri :as u])
|
||||
(:import
|
||||
java.io.InputStream
|
||||
java.io.OutputStream
|
||||
java.nio.file.Path
|
||||
java.time.Duration
|
||||
java.util.Collection
|
||||
software.amazon.awssdk.core.sync.RequestBody
|
||||
software.amazon.awssdk.regions.Region
|
||||
software.amazon.awssdk.services.s3.S3Client
|
||||
software.amazon.awssdk.services.s3.S3ClientBuilder
|
||||
software.amazon.awssdk.services.s3.model.Delete
|
||||
software.amazon.awssdk.services.s3.model.CopyObjectRequest
|
||||
software.amazon.awssdk.services.s3.model.DeleteObjectsRequest
|
||||
|
@ -113,7 +108,7 @@
|
|||
:eu-central-1 Region/EU_CENTRAL_1))
|
||||
|
||||
(defn- build-s3-client
|
||||
[{:keys [region bucket]}]
|
||||
[{:keys [region]}]
|
||||
(.. (S3Client/builder)
|
||||
(region (lookup-region region))
|
||||
(build)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue