1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

r12701: the first scavenging run should happen after half of the renew_interval,

and not on startup

metze
This commit is contained in:
Stefan Metzmacher 2006-01-03 20:07:34 +00:00 committed by Gerald (Jerry) Carter
parent 72198f00ea
commit fd234ebbac

View File

@ -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;
}