~rjarry/dlrepo

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
2 2

[PATCH dlrepo] fs: allow disabling periodic cleanup

Details
Message ID
<20241003124033.698074-1-julien.floret@6wind.com>
DKIM signature
pass
Download raw message
Patch: +4 -0
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] build failed

builds.sr.ht <builds@sr.ht>
Details
Message ID
<D4M6G31W876O.3QM1MU4ARP6GD@fra02>
In-Reply-To
<20241003124033.698074-1-julien.floret@6wind.com> (view parent)
DKIM signature
missing
Download raw message
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]: julien.floret@6wind.com

✗ #1343420 FAILED dlrepo/patches/.build.yml https://builds.sr.ht/~rjarry/job/1343420

Applied: [PATCH dlrepo] fs: allow disabling periodic cleanup

Details
Message ID
<172808324239.1037873.15688927965837881256@ringo.home>
In-Reply-To
<20241003124033.698074-1-julien.floret@6wind.com> (view parent)
DKIM signature
pass
Download raw message
Julien Floret <julien.floret@6wind.com> wrote:
> 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>
> ---

Acked-by: Robin Jarry <robin@jarry.cc>

Applied, thanks.

To git@git.sr.ht:~rjarry/dlrepo
   1140c1b3dcc9..e3c2f693a68c  main -> main
Reply to thread Export thread (mbox)