♻️ Reimplement GC mechanism for penpot database objects.

This commit is contained in:
Andrey Antukh 2021-06-07 16:51:09 +02:00 committed by Andrés Moya
parent 71c4145ea2
commit 860e0227af
20 changed files with 437 additions and 104 deletions

View file

@ -15,7 +15,7 @@
[app.rpc.mutations.profile :as profile]
[app.setup.initial-data :as sid]
[app.util.services :as sv]
[app.worker :as wrk]
[app.util.time :as dt]
[buddy.core.codecs :as bc]
[buddy.core.nonce :as bn]
[clojure.spec.alpha :as s]))
@ -35,6 +35,7 @@
:email email
:fullname fullname
:is-demo true
:deleted-at (dt/in-future cfg/deletion-delay)
:password password
:props {:onboarding-viewed true}}]
@ -48,12 +49,6 @@
(#'profile/create-profile-relations conn)
(sid/load-initial-project! conn))
;; Schedule deletion of the demo profile
(wrk/submit! {::wrk/task :delete-profile
::wrk/delay cfg/deletion-delay
::wrk/conn conn
:profile-id id})
(with-meta {:email email
:password password}
{::audit/profile-id id}))))