mirror of
https://github.com/penpot/penpot.git
synced 2025-03-12 15:51:37 -05:00
🐛 Process thumbnail creation in serie (less resource usage).
This commit is contained in:
parent
121d300cf7
commit
aaa8bfe67d
3 changed files with 8 additions and 7 deletions
|
@ -79,7 +79,7 @@
|
|||
|
||||
(defn populate-thumbnail
|
||||
[entry {:keys [src dst] :as opts}]
|
||||
{:pre [(map? entry)]}
|
||||
(assert (map? entry))
|
||||
(let [src (if (vector? src) src [src])
|
||||
dst (if (vector? dst) dst [dst])
|
||||
src (get-in entry src)]
|
||||
|
@ -93,8 +93,8 @@
|
|||
|
||||
(defn populate-urls
|
||||
[entry storage src dst]
|
||||
{:pre [(map? entry)
|
||||
(st/storage? storage)]}
|
||||
(assert (map? entry))
|
||||
(assert (st/storage? storage))
|
||||
(let [src (if (vector? src) src [src])
|
||||
dst (if (vector? dst) dst [dst])
|
||||
value (get-in entry src)]
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
(defn populate-thumbnail
|
||||
[row]
|
||||
(let [opts +thumbnail-options+]
|
||||
(-> (px/submit! #(images/populate-thumbnails row opts))
|
||||
(su/handle-on-context))))
|
||||
(-> (p/promise row)
|
||||
(p/then (vc/wrap-blocking #(images/populate-thumbnail % opts))))))
|
||||
|
||||
(defn populate-thumbnails
|
||||
[rows]
|
||||
|
|
5
backend/vendor/vertx/src/vertx/core.clj
vendored
5
backend/vendor/vertx/src/vertx/core.clj
vendored
|
@ -71,12 +71,13 @@
|
|||
(.complete ^Promise prm (apply f args))
|
||||
(catch Throwable e
|
||||
(.fail ^Promise prm e)))))
|
||||
false
|
||||
true
|
||||
(reify Handler
|
||||
(handle [_ ar]
|
||||
(if (.failed ^AsyncResult ar)
|
||||
(p/reject! d (.cause ^AsyncResult ar))
|
||||
(p/resolve! d (.result ^AsyncResult ar)))))))))))
|
||||
(p/resolve! d (.result ^AsyncResult ar))))))
|
||||
d)))))
|
||||
|
||||
(defn handle-on-context
|
||||
"Attaches the context (current if not explicitly provided) to the
|
||||
|
|
Loading…
Add table
Reference in a new issue