summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-01-03 20:07:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:49:41 -0500
commit0817627746d947555947ff767239358d15b1e1b8 (patch)
treeb29ce82668a212e5723f3652c47f642fc06887f7
parenta417674925b745d44da536d9d69e907afa4a0f88 (diff)
downloadsamba-0817627746d947555947ff767239358d15b1e1b8.tar.gz
samba-0817627746d947555947ff767239358d15b1e1b8.tar.bz2
samba-0817627746d947555947ff767239358d15b1e1b8.zip
r12701: the first scavenging run should happen after half of the renew_interval,
and not on startup metze (This used to be commit fd234ebbac30a10083e2898eb291d8a4fef7198f)
-rw-r--r--source4/wrepl_server/wrepl_scavenging.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/wrepl_server/wrepl_scavenging.c b/source4/wrepl_server/wrepl_scavenging.c
index 2988fb6b22..a5275761a0 100644
--- a/source4/wrepl_server/wrepl_scavenging.c
+++ b/source4/wrepl_server/wrepl_scavenging.c
@@ -360,15 +360,28 @@ NTSTATUS wreplsrv_scavenging_run(struct wreplsrv_service *service)
{
NTSTATUS status;
TALLOC_CTX *tmp_mem;
+ BOOL skip_first_run = False;
if (!timeval_expired(&service->scavenging.next_run)) {
return NT_STATUS_OK;
}
+ if (timeval_is_zero(&service->scavenging.next_run)) {
+ skip_first_run = True;
+ }
+
service->scavenging.next_run = timeval_current_ofs(service->config.scavenging_interval, 0);
status = wreplsrv_periodic_schedule(service, service->config.scavenging_interval);
NT_STATUS_NOT_OK_RETURN(status);
+ /*
+ * if it's the first time this functions is called (startup)
+ * the next_run is zero, in this case we should not do scavenging
+ */
+ if (skip_first_run) {
+ return NT_STATUS_OK;
+ }
+
if (service->scavenging.processing) {
return NT_STATUS_OK;
}