mirror of
https://github.com/penpot/penpot.git
synced 2025-01-21 14:12:36 -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"
|
:host "localhost"
|
||||||
:http-server-port 6061
|
:http-server-port 6061
|
||||||
:http-server-host "0.0.0.0"
|
:http-server-host "0.0.0.0"
|
||||||
|
:tempdir "/tmp/penpot-exporter"
|
||||||
:redis-uri "redis://redis/0"})
|
:redis-uri "redis://redis/0"})
|
||||||
|
|
||||||
(def ^:private schema:config
|
(def ^:private schema:config
|
||||||
|
@ -32,6 +33,7 @@
|
||||||
[:tenant {:optional true} :string]
|
[:tenant {:optional true} :string]
|
||||||
[:flags {:optional true} ::sm/set-of-keywords]
|
[:flags {:optional true} ::sm/set-of-keywords]
|
||||||
[:redis-uri {:optional true} :string]
|
[:redis-uri {:optional true} :string]
|
||||||
|
[:tempdir {:optional true} :string]
|
||||||
[:browser-pool-max {:optional true} :int]
|
[:browser-pool-max {:optional true} :int]
|
||||||
[:browser-pool-min {:optional true} :int]])
|
[:browser-pool-min {:optional true} :int]])
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
[app.common.exceptions :as ex]
|
[app.common.exceptions :as ex]
|
||||||
[app.common.logging :as l]
|
[app.common.logging :as l]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
|
[app.config :as cf]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[promesa.core :as p]))
|
[promesa.core :as p]))
|
||||||
|
|
||||||
|
@ -22,12 +23,12 @@
|
||||||
(def tempfile-minage (* 1000 60 60 1)) ;; 1h
|
(def tempfile-minage (* 1000 60 60 1)) ;; 1h
|
||||||
|
|
||||||
(def tmpdir
|
(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)
|
(when-not (fs/existsSync path)
|
||||||
(fs/mkdirSync path #js {:recursive true}))
|
(fs/mkdirSync path #js {:recursive true}))
|
||||||
path))
|
path))
|
||||||
|
|
||||||
|
|
||||||
(defn- schedule-deletion!
|
(defn- schedule-deletion!
|
||||||
[path]
|
[path]
|
||||||
(letfn [(remote-tempfile []
|
(letfn [(remote-tempfile []
|
||||||
|
|
Loading…
Add table
Reference in a new issue