diff --git a/pandora_agents/win32/ChangeLog b/pandora_agents/win32/ChangeLog index 4ef061d4f3..15c8d8cf3e 100644 --- a/pandora_agents/win32/ChangeLog +++ b/pandora_agents/win32/ChangeLog @@ -1,3 +1,10 @@ +2009-10-06 Ramon Novoa + + * main.cc: Fixed the agent interval when running in process mode. + + * pandora_windows_service.cc: Moved the startup delay to the right + place. + 2009-10-05 Ramon Novoa * ftp/pandora_ftp_client.h: Fixed the path of curl.h to match diff --git a/pandora_agents/win32/main.cc b/pandora_agents/win32/main.cc index 45343cad1d..1971cbb151 100644 --- a/pandora_agents/win32/main.cc +++ b/pandora_agents/win32/main.cc @@ -142,7 +142,7 @@ main (int argc, char *argv[]) { service->pandora_init (); while (1) { service->pandora_run (); - Sleep (service->interval * 1000); + Sleep (service->interval); } } else { service->run (); diff --git a/pandora_agents/win32/pandora_windows_service.cc b/pandora_agents/win32/pandora_windows_service.cc index 0737319532..6364affc78 100644 --- a/pandora_agents/win32/pandora_windows_service.cc +++ b/pandora_agents/win32/pandora_windows_service.cc @@ -113,6 +113,7 @@ void Pandora_Windows_Service::pandora_init () { string conf_file, interval, debug, transfer_interval; string udp_server_enabled, udp_server_port, udp_server_addr, udp_server_auth_addr; + int startup_delay = 0; setPandoraDebug (true); @@ -151,7 +152,14 @@ Pandora_Windows_Service::pandora_init () { srand ((unsigned) time (0)); this->setSleepTime (this->interval); - + + /* Sleep if a startup delay was specified */ + startup_delay = atoi (conf->getValue ("startup_delay").c_str ()) * 1000; + if (startup_delay > 0) { + pandoraLog ("Delaying startup %d seconds", startup_delay); + Sleep (startup_delay); + } + pandoraLog ("Pandora agent started"); /* Launch UDP Server */ @@ -816,18 +824,10 @@ void Pandora_Windows_Service::pandora_run () { Pandora_Agent_Conf *conf = NULL; string server_addr; - int startup_delay = 0; pandoraDebug ("Run begin"); conf = this->getConf (); - - /* Sleep if a startup delay was specified */ - startup_delay = atoi (conf->getValue ("startup_delay").c_str ()); - if (startup_delay > 0) { - pandoraLog ("Delaying startup %d seconds", startup_delay); - Sleep (startup_delay); - } /* Check for configuration changes */ this->checkConfig ();