mirror of
https://github.com/penpot/penpot.git
synced 2025-06-29 05:57:01 +02:00
📎 Fix linter issues.
This commit is contained in:
parent
8daf6e822e
commit
d889d39151
7 changed files with 9 additions and 21 deletions
|
@ -5,7 +5,7 @@
|
||||||
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
;; This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||||
;; defined by the Mozilla Public License, v. 2.0.
|
;; defined by the Mozilla Public License, v. 2.0.
|
||||||
;;
|
;;
|
||||||
;; Copyright (c) 2020 UXBOX Labs SL
|
;; Copyright (c) UXBOX Labs SL
|
||||||
|
|
||||||
(ns app.db
|
(ns app.db
|
||||||
(:require
|
(:require
|
||||||
|
@ -16,8 +16,8 @@
|
||||||
[app.db.sql :as sql]
|
[app.db.sql :as sql]
|
||||||
[app.metrics :as mtx]
|
[app.metrics :as mtx]
|
||||||
[app.util.json :as json]
|
[app.util.json :as json]
|
||||||
[app.util.migrations :as mg]
|
|
||||||
[app.util.logging :as l]
|
[app.util.logging :as l]
|
||||||
|
[app.util.migrations :as mg]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[app.util.transit :as t]
|
[app.util.transit :as t]
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
[app.metrics :as mtx]
|
[app.metrics :as mtx]
|
||||||
[app.util.logging :as l]
|
[app.util.logging :as l]
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
[clojure.tools.logging :as log]
|
|
||||||
[integrant.core :as ig]
|
[integrant.core :as ig]
|
||||||
[reitit.ring :as rr]
|
[reitit.ring :as rr]
|
||||||
[ring.adapter.jetty9 :as jetty])
|
[ring.adapter.jetty9 :as jetty])
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
[app.db.sql :as sql]
|
[app.db.sql :as sql]
|
||||||
[app.util.http :as http]
|
[app.util.http :as http]
|
||||||
[app.util.logging :as l]
|
[app.util.logging :as l]
|
||||||
[clojure.pprint :refer [pprint]]
|
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[integrant.core :as ig]
|
[integrant.core :as ig]
|
||||||
|
|
|
@ -178,6 +178,6 @@
|
||||||
::l/logger logger
|
::l/logger logger
|
||||||
:ip-addr ip-addr
|
:ip-addr ip-addr
|
||||||
:profile-id profile-id
|
:profile-id profile-id
|
||||||
:uri (str (:uri request) (if qstring (str "?" qstring)))
|
:uri (str (:uri request) (when qstring (str "?" qstring)))
|
||||||
:method (name (:request-method request)))
|
:method (name (:request-method request)))
|
||||||
(handler request)))))
|
(handler request)))))
|
||||||
|
|
|
@ -149,9 +149,7 @@
|
||||||
:out-ch out-ch
|
:out-ch out-ch
|
||||||
:sub-ch sub-ch)]
|
:sub-ch sub-ch)]
|
||||||
|
|
||||||
(l/log :level :trace
|
(l/trace :event "connect" :session (:session-id cfg))
|
||||||
:action "connect"
|
|
||||||
:session (:session-id cfg))
|
|
||||||
|
|
||||||
;; Forward all messages from out-ch to the websocket
|
;; Forward all messages from out-ch to the websocket
|
||||||
;; connection
|
;; connection
|
||||||
|
@ -173,18 +171,14 @@
|
||||||
;; close subscription
|
;; close subscription
|
||||||
(a/close! sub-ch))))
|
(a/close! sub-ch))))
|
||||||
|
|
||||||
(on-error [_conn e]
|
(on-error [_conn _e]
|
||||||
(l/log :level :trace
|
(l/trace :event "error" :session (:session-id cfg))
|
||||||
:action "error"
|
|
||||||
:session (:session-id cfg))
|
|
||||||
|
|
||||||
(a/close! out-ch)
|
(a/close! out-ch)
|
||||||
(a/close! rcv-ch))
|
(a/close! rcv-ch))
|
||||||
|
|
||||||
(on-close [_conn _status _reason]
|
(on-close [_conn _status _reason]
|
||||||
(l/log :level :trace
|
(l/trace :event "close" :session (:session-id cfg))
|
||||||
:action "close"
|
|
||||||
:session (:session-id cfg))
|
|
||||||
|
|
||||||
(a/close! out-ch)
|
(a/close! out-ch)
|
||||||
(a/close! rcv-ch))
|
(a/close! rcv-ch))
|
||||||
|
@ -192,8 +186,7 @@
|
||||||
(on-message [_ws message]
|
(on-message [_ws message]
|
||||||
(let [message (t/decode-str message)]
|
(let [message (t/decode-str message)]
|
||||||
(when-not (a/offer! rcv-ch message)
|
(when-not (a/offer! rcv-ch message)
|
||||||
(l/log :level :warn
|
(l/warn :msg "drop messages"))))]
|
||||||
:msg "drop messages"))))]
|
|
||||||
|
|
||||||
{:on-connect on-connect
|
{:on-connect on-connect
|
||||||
:on-error on-error
|
:on-error on-error
|
||||||
|
|
|
@ -9,10 +9,8 @@
|
||||||
|
|
||||||
(ns app.util.logging
|
(ns app.util.logging
|
||||||
(:require
|
(:require
|
||||||
[linked.core :as lk]
|
|
||||||
[clojure.pprint :refer [pprint]])
|
[clojure.pprint :refer [pprint]])
|
||||||
(:import
|
(:import
|
||||||
java.util.Map
|
|
||||||
org.apache.logging.log4j.Level
|
org.apache.logging.log4j.Level
|
||||||
org.apache.logging.log4j.LogManager
|
org.apache.logging.log4j.LogManager
|
||||||
org.apache.logging.log4j.Logger
|
org.apache.logging.log4j.Logger
|
||||||
|
@ -65,7 +63,7 @@
|
||||||
^Object msg)))
|
^Object msg)))
|
||||||
|
|
||||||
(defmacro log
|
(defmacro log
|
||||||
[& {:keys [level cause msg ::logger ::async] :as props}]
|
[& {:keys [level cause ::logger ::async] :as props}]
|
||||||
(let [props (dissoc props :level :cause ::logger ::async)
|
(let [props (dissoc props :level :cause ::logger ::async)
|
||||||
logger (or logger (str *ns*))
|
logger (or logger (str *ns*))
|
||||||
logger-sym (gensym "log")
|
logger-sym (gensym "log")
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
[app.util.logging :as l]
|
[app.util.logging :as l]
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
[clojure.spec.alpha :as s]
|
[clojure.spec.alpha :as s]
|
||||||
[cuerdas.core :as str]
|
|
||||||
[next.jdbc :as jdbc]))
|
[next.jdbc :as jdbc]))
|
||||||
|
|
||||||
(s/def ::name string?)
|
(s/def ::name string?)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue