0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-04-01 09:31:26 -05:00

Add the ability to setup custom tempdir on exporter

This commit is contained in:
Andrey Antukh 2023-11-13 18:27:51 +01:00
parent 4af76f9a9a
commit b37acf75ce
2 changed files with 4 additions and 2 deletions

View file

@ -22,6 +22,7 @@
:host "localhost"
:http-server-port 6061
:http-server-host "0.0.0.0"
:tempdir "/tmp/penpot-exporter"
:redis-uri "redis://redis/0"})
(s/def ::http-server-port ::us/integer)

View file

@ -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 []