~rjarry/dlrepo

dlrepo: fs: allow disabling periodic cleanup v1 APPLIED

Julien Floret: 1
 fs: allow disabling periodic cleanup

 2 files changed, 4 insertions(+), 0 deletions(-)
#1343420 .build.yml failed
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rjarry/dlrepo/patches/55289/mbox | git am -3
Learn more about email & git

[PATCH dlrepo] fs: allow disabling periodic cleanup Export this patch

It is impractical to rely on the periodic cleanup, because the
time of the cleanup depends on the time when the server started.
So if we want to setup let's say a daily cleanup at 8 AM, we have to
start the server at 8 AM beforehand.

Allow disabling periodic cleanup altogether by setting the
DLREPO_TAG_CLEANUP_PERIOD to 0.

As a reminder, the tag cleanup can also be triggered from an external
script by sending the USR1 signal to the server. This method allows
more control over the cleanup schedule.

Signed-off-by: Julien Floret <julien.floret@6wind.com>
Acked-by: Thomas Faivre <thomas.faivre@6wind.com>
---
 dlrepo/fs/__init__.py      | 2 ++
 docs/dlrepo-config.5.scdoc | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/dlrepo/fs/__init__.py b/dlrepo/fs/__init__.py
index 13752248c4f4..861fe3f0c1c0 100644
--- a/dlrepo/fs/__init__.py
+++ b/dlrepo/fs/__init__.py
@@ -117,6 +117,8 @@ class ArtifactRepository(AbstractRepository):
        self.start_cleanup_timer()

    def start_cleanup_timer(self):
        if self.CLEANUP_PERIOD == 0:
            return
        self.cleanup_timer = asyncio.get_running_loop().call_later(
            self.CLEANUP_PERIOD, self._cleanup_timer_cb
        )
diff --git a/docs/dlrepo-config.5.scdoc b/docs/dlrepo-config.5.scdoc
index 8cf636ed0994..7fdaefa56e59 100644
--- a/docs/dlrepo-config.5.scdoc
+++ b/docs/dlrepo-config.5.scdoc
@@ -57,6 +57,8 @@ running the daemon process.
	according to each branch cleanup policy, refresh each user quotas and
	finally perform garbage collection on the orphan blobs.

	Setting this variable to _0_ disables periodic cleanup.

	This cleanup can also be triggered by sending the SIGUSR1 signal to the
	dlrepo process.

-- 
2.39.2
dlrepo/patches/.build.yml: FAILED in 26s

[fs: allow disabling periodic cleanup][0] from [Julien Floret][1]

[0]: https://lists.sr.ht/~rjarry/dlrepo/patches/55289
[1]: mailto:julien.floret@6wind.com

✗ #1343420 FAILED dlrepo/patches/.build.yml https://builds.sr.ht/~rjarry/job/1343420
Julien Floret <julien.floret@6wind.com> wrote: