🎉 Add refcount-like functionality to storages.

This allows reuse of storage objects among different files.
This commit is contained in:
Andrey Antukh 2021-01-29 23:56:11 +01:00 committed by Alonso Torres
parent b57e63d7d6
commit e54b443247
7 changed files with 130 additions and 23 deletions

View file

@ -55,11 +55,14 @@
:app.tokens/tokens
{:sprops (ig/ref :app.sprops/props)}
:app.storage/gc-task
:app.storage/gc-deleted-task
{:pool (ig/ref :app.db/pool)
:storage (ig/ref :app.storage/storage)
:min-age (dt/duration {:hours 2})}
:app.storage/gc-touched-task
{:pool (ig/ref :app.db/pool)}
:app.storage/recheck-task
{:pool (ig/ref :app.db/pool)
:storage (ig/ref :app.storage/storage)}
@ -192,9 +195,13 @@
:cron #app/cron "0 0 */6 * * ?" ;; every 2 hours
:fn (ig/ref :app.tasks.file-xlog-gc/handler)}
{:id "storage-gc"
{:id "storage-deleted-gc"
:cron #app/cron "0 0 */6 * * ?" ;; every 6 hours
:fn (ig/ref :app.storage/gc-task)}
:fn (ig/ref :app.storage/gc-deleted-task)}
{:id "storage-touched-gc"
:cron #app/cron "0 30 */6 * * ?" ;; every 6 hours
:fn (ig/ref :app.storage/gc-touched-task)}
{:id "storage-recheck"
:cron #app/cron "0 0 */6 * * ?" ;; every 6 hours