0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-03-27 15:11:26 -05:00

Merge remote-tracking branch 'origin/staging'

This commit is contained in:
Alejandro Alonso 2024-04-08 14:56:34 +02:00
commit 8093555acc
10 changed files with 39 additions and 27 deletions

View file

@ -26,7 +26,6 @@ export PENPOT_FLAGS="\
enable-soft-rpc-rlimit \
enable-webhooks \
enable-access-tokens \
disable-feature-components-v2 \
enable-file-validation \
enable-file-schema-validation";

View file

@ -18,7 +18,6 @@ export PENPOT_FLAGS="\
enable-rpc-climit \
enable-smtp \
enable-access-tokens \
disable-feature-components-v2 \
enable-file-validation \
enable-file-schema-validation";

View file

@ -468,7 +468,7 @@
(defn- read-import-v1
[{:keys [::db/conn ::project-id ::profile-id ::input] :as cfg}]
(db/exec-one! conn ["SET idle_in_transaction_session_timeout = 0"])
(db/exec-one! conn ["SET LOCAL idle_in_transaction_session_timeout = 0"])
(db/exec-one! conn ["SET CONSTRAINTS ALL DEFERRED"])
(pu/with-open [input (zstd-input-stream input)

View file

@ -218,6 +218,14 @@
:hint (ex-message error)
:data edata}}))))
(defmethod handle-exception java.io.IOException
[cause _ _]
(l/wrn :hint "io exception" :cause cause)
{::rres/status 500
::rres/body {:type :server-error
:code :io-exception
:hint (ex-message cause)}})
(defmethod handle-exception java.util.concurrent.CompletionException
[cause request _]
(let [cause' (ex-cause cause)]

View file

@ -67,12 +67,10 @@
[_ {:keys [::db/pool] :as cfg}]
(fn [{:keys [props] :as task}]
(let [event (::event props)]
(l/debug :hint "process webhook event"
:name (:name event))
(l/dbg :hint "process webhook event" :name (:name event))
(when-let [items (lookup-webhooks cfg event)]
(l/trace :hint "webhooks found for event" :total (count items))
(l/trc :hint "webhooks found for event" :total (count items))
(db/with-atomic [conn pool]
(doseq [item items]

View file

@ -65,18 +65,16 @@
;; --- Command: import-binfile
(defn- import-binfile
[{:keys [::wrk/executor ::bf.v1/project-id] :as cfg} input]
(db/tx-run! cfg
(fn [{:keys [::db/conn] :as cfg}]
;; NOTE: the importation process performs some operations that
;; are not very friendly with virtual threads, and for avoid
;; unexpected blocking of other concurrent operations we
;; dispatch that operation to a dedicated executor.
(let [result (px/invoke! executor (partial bf.v1/import-files! cfg input))]
(db/update! conn :project
{:modified-at (dt/now)}
{:id project-id})
result))))
[{:keys [::wrk/executor ::bf.v1/project-id ::db/pool] :as cfg} input]
;; NOTE: the importation process performs some operations that
;; are not very friendly with virtual threads, and for avoid
;; unexpected blocking of other concurrent operations we
;; dispatch that operation to a dedicated executor.
(let [result (px/invoke! executor (partial bf.v1/import-files! cfg input))]
(db/update! pool :project
{:modified-at (dt/now)}
{:id project-id})
result))
(def ^:private
schema:import-binfile

View file

@ -56,7 +56,7 @@
(db/create-array conn "uuid" ids)]]
(db/exec-one! conn sql)
(l/trc :hist "queue tasks"
(l/trc :hist "enqueue tasks on redis"
:queue queue
:tasks (count ids)
:queued res)))

View file

@ -140,20 +140,20 @@
:else
(try
(l/trc :hint "start task"
:queue queue
:runner-id id
:name (:name task)
:task-id (str task-id)
:queue queue
:runner-id id
:retry (:retry-num task))
(let [tpoint (dt/tpoint)
result (handle-task task)
elapsed (dt/format-duration (tpoint))]
(l/trc :hint "end task"
:queue queue
:runner-id id
:name (:name task)
:task-id (str task-id)
:queue queue
:runner-id id
:retry (:retry-num task)
:elapsed elapsed)

View file

@ -58,7 +58,8 @@
(def default-enabled-features
#{"fdata/shape-data-type"
"styles/v2"
"layout/grid"})
"layout/grid"
"components/v2"})
;; A set of features which only affects on frontend and can be enabled
;; and disabled freely by the user any time. This features does not

View file

@ -14,11 +14,20 @@ http {
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
reset_timedout_connection on;
client_body_timeout 20s;
client_header_timeout 20s;
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
send_timeout 300s;
include /etc/nginx/mime.types;
default_type application/octet-stream;
@ -33,7 +42,7 @@ http {
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css text/javascript application/javascript application/json application/transit+json;
gzip_types text/plain text/css text/javascript application/javascript application/json application/transit+json image/svg+xml;
map $http_upgrade $connection_upgrade {
default upgrade;