0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 08:20:45 -05:00

Prevent high cpu usage on reporting big errors.

This commit is contained in:
Andrey Antukh 2022-01-26 18:09:59 +01:00
parent d892be4971
commit 0092806dda

View file

@ -30,10 +30,13 @@
:method (:request-method request)
:hint (ex-message error)
:params (:params request)
:spec-problems (some-> data ::s/problems)
:spec-value (some-> data ::s/value)
:spec-explain (with-out-str
(expound/printer data))
:spec-problems (some->> data ::s/problems (take 10) seq vec)
:spec-value (some->> data ::s/value)
:spec-explain (binding [s/*explain-out* expound/printer]
(with-out-str
(s/explain-out (update data ::s/problems #(take 10 %)))))
:data (some-> data (dissoc ::s/problems ::s/value :hint))
:ip-addr (parse-client-ip request)
:profile-id (:profile-id request)}