From 0817627746d947555947ff767239358d15b1e1b8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 3 Jan 2006 20:07:34 +0000 Subject: r12701: the first scavenging run should happen after half of the renew_interval, and not on startup metze (This used to be commit fd234ebbac30a10083e2898eb291d8a4fef7198f) --- source4/wrepl_server/wrepl_scavenging.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'source4') 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; } -- cgit