0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-24 07:29:08 -05:00

Merge remote-tracking branch 'origin/main' into develop

This commit is contained in:
Andrey Antukh 2021-06-02 13:15:23 +02:00
commit 9bc2f7dce4
5 changed files with 20 additions and 14 deletions

View file

@ -20,6 +20,10 @@
### :bug: Bugs fixed ### :bug: Bugs fixed
- Fix problem with merge and join nodes [#990](https://github.com/penpot/penpot/issues/990) - Fix problem with merge and join nodes [#990](https://github.com/penpot/penpot/issues/990)
- Fix problem with empty path editing.
- Fix problem with create component.
- Fix problem with move-objects.
- Fix problem with merge and join nodes.
## 1.6.2-alpha ## 1.6.2-alpha

View file

@ -140,10 +140,13 @@
(when-let [[reason batch] (a/<! input)] (when-let [[reason batch] (a/<! input)]
(let [result (a/<! (update-sessions cfg batch))] (let [result (a/<! (update-sessions cfg batch))]
(mcnt :inc) (mcnt :inc)
(if (ex/exception? result) (cond
(ex/exception? result)
(l/error :task "updater" (l/error :task "updater"
:hint "unexpected error on update sessions" :hint "unexpected error on update sessions"
:cause result) :cause result)
(= :size reason)
(l/debug :task "updater" (l/debug :task "updater"
:action "update sessions" :action "update sessions"
:reason (name reason) :reason (name reason)

View file

@ -75,15 +75,12 @@
[_ {:keys [enabled] :as cfg}] [_ {:keys [enabled] :as cfg}]
(when enabled (when enabled
(l/info :msg "intializing audit collector") (l/info :msg "intializing audit collector")
(let [input (a/chan 1 event-xform) (let [input (a/chan 512 event-xform)
buffer (aa/batch input {:max-batch-size 100 buffer (aa/batch input {:max-batch-size 100
:max-batch-age (* 5 1000) :max-batch-age (* 10 1000) ; 10s
:init []})] :init []})]
(a/go-loop [] (a/go-loop []
(when-let [[type events] (a/<! buffer)] (when-let [[type events] (a/<! buffer)]
(l/debug :action "persist-events (batch)"
:reason (name type)
:count (count events))
(let [res (a/<! (persist-events cfg events))] (let [res (a/<! (persist-events cfg events))]
(when (ex/exception? res) (when (ex/exception? res)
(l/error :hint "error on persiting events" (l/error :hint "error on persiting events"

View file

@ -166,25 +166,25 @@
:tasks (ig/ref :app.worker/registry) :tasks (ig/ref :app.worker/registry)
:pool (ig/ref :app.db/pool) :pool (ig/ref :app.db/pool)
:schedule :schedule
[{:cron #app/cron "0 0 0 */1 * ? *" ;; daily [{:cron #app/cron "0 0 0 * * ? *" ;; daily
:task :file-media-gc} :task :file-media-gc}
{:cron #app/cron "0 0 */1 * * ?" ;; hourly {:cron #app/cron "0 0 * * * ?" ;; hourly
:task :file-xlog-gc} :task :file-xlog-gc}
{:cron #app/cron "0 0 1 */1 * ?" ;; daily (1 hour shift) {:cron #app/cron "0 0 1 * * ?" ;; daily (1 hour shift)
:task :storage-deleted-gc} :task :storage-deleted-gc}
{:cron #app/cron "0 0 2 */1 * ?" ;; daily (2 hour shift) {:cron #app/cron "0 0 2 * * ?" ;; daily (2 hour shift)
:task :storage-touched-gc} :task :storage-touched-gc}
{:cron #app/cron "0 0 3 */1 * ?" ;; daily (3 hour shift) {:cron #app/cron "0 0 3 * * ?" ;; daily (3 hour shift)
:task :session-gc} :task :session-gc}
{:cron #app/cron "0 0 */1 * * ?" ;; hourly {:cron #app/cron "0 0 * * * ?" ;; hourly
:task :storage-recheck} :task :storage-recheck}
{:cron #app/cron "0 0 0 */1 * ?" ;; daily {:cron #app/cron "0 0 0 * * ?" ;; daily
:task :tasks-gc} :task :tasks-gc}
(when (cf/get :audit-archive-enabled) (when (cf/get :audit-archive-enabled)

View file

@ -64,12 +64,14 @@
(defn batch (defn batch
[in {:keys [max-batch-size [in {:keys [max-batch-size
max-batch-age max-batch-age
buffer-size
init] init]
:or {max-batch-size 200 :or {max-batch-size 200
max-batch-age (* 30 1000) max-batch-age (* 30 1000)
buffer-size 128
init #{}} init #{}}
:as opts}] :as opts}]
(let [out (a/chan)] (let [out (a/chan buffer-size)]
(a/go-loop [tch (a/timeout max-batch-age) buf init] (a/go-loop [tch (a/timeout max-batch-age) buf init]
(let [[val port] (a/alts! [tch in])] (let [[val port] (a/alts! [tch in])]
(cond (cond