mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 06:02:32 -05:00
✨ Add the ability to setup custom tempdir on exporter
This commit is contained in:
parent
26d3d7f1a8
commit
5ebef181ae
2 changed files with 5 additions and 2 deletions
|
@ -23,6 +23,7 @@
|
|||
:host "localhost"
|
||||
:http-server-port 6061
|
||||
:http-server-host "0.0.0.0"
|
||||
:tempdir "/tmp/penpot-exporter"
|
||||
:redis-uri "redis://redis/0"})
|
||||
|
||||
(def ^:private schema:config
|
||||
|
@ -32,6 +33,7 @@
|
|||
[:tenant {:optional true} :string]
|
||||
[:flags {:optional true} ::sm/set-of-keywords]
|
||||
[:redis-uri {:optional true} :string]
|
||||
[:tempdir {:optional true} :string]
|
||||
[:browser-pool-max {:optional true} :int]
|
||||
[:browser-pool-min {:optional true} :int]])
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
[app.common.exceptions :as ex]
|
||||
[app.common.logging :as l]
|
||||
[app.common.uuid :as uuid]
|
||||
[app.config :as cf]
|
||||
[cuerdas.core :as str]
|
||||
[promesa.core :as p]))
|
||||
|
||||
|
@ -22,12 +23,12 @@
|
|||
(def tempfile-minage (* 1000 60 60 1)) ;; 1h
|
||||
|
||||
(def tmpdir
|
||||
(let [path (path/join (os/tmpdir) "penpot")]
|
||||
(let [path (cf/get :tempdir)]
|
||||
(l/inf :hint "tmptdir setup" :path path)
|
||||
(when-not (fs/existsSync path)
|
||||
(fs/mkdirSync path #js {:recursive true}))
|
||||
path))
|
||||
|
||||
|
||||
(defn- schedule-deletion!
|
||||
[path]
|
||||
(letfn [(remote-tempfile []
|
||||
|
|
Loading…
Add table
Reference in a new issue