r12391: use the new periodic schedule system for the pull replication too
[kai/samba-autobuild/.git] / source4 / wrepl_server / wrepl_periodic.c
index 28c966879ae119f021975f6f6665bc692cbce28a..2cea3b8e7c3940c864a183bca5c07daf2ca2ae0e 100644 (file)
@@ -39,6 +39,9 @@ static NTSTATUS wreplsrv_periodic_run(struct wreplsrv_service *service)
 {
        NTSTATUS status;
 
+       status = wreplsrv_out_pull_run(service);
+       NT_STATUS_NOT_OK_RETURN(status);
+
        status = wreplsrv_out_push_run(service);
        NT_STATUS_NOT_OK_RETURN(status);
 
@@ -74,7 +77,7 @@ NTSTATUS wreplsrv_periodic_schedule(struct wreplsrv_service *service, uint32_t n
        /* prevent looping */
        if (next_interval == 0) next_interval = 1;
 
-       next_time = timeval_current_ofs(next_interval, 0);
+       next_time = timeval_current_ofs(next_interval, 5000);
 
        if (service->periodic.te) {
                /*
@@ -111,13 +114,6 @@ NTSTATUS wreplsrv_setup_periodic(struct wreplsrv_service *service)
 {
        NTSTATUS status;
 
-       /*
-        * TODO: this should go away, and we should do everything
-        *        within the wreplsrv_periodic_run()
-        */
-       status = wreplsrv_setup_out_connections(service);
-       NT_STATUS_NOT_OK_RETURN(status);
-
        status = wreplsrv_periodic_schedule(service, 0);
        NT_STATUS_NOT_OK_RETURN(status);