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
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