2009-10-06 Ramon Novoa <rnovoa@artica.es>

* main.cc: Fixed the agent interval when running in process mode.

        * pandora_windows_service.cc: Moved the startup delay to the right
          place.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2001 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
Ramon Novoa 2009-10-06 10:55:59 +00:00
parent 3e290f3ecd
commit 79376ea722
3 changed files with 17 additions and 10 deletions

View File

@ -1,3 +1,10 @@
2009-10-06 Ramon Novoa <rnovoa@artica.es>
* 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 <rnovoa@artica.es>
* ftp/pandora_ftp_client.h: Fixed the path of curl.h to match

View File

@ -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 ();

View File

@ -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 ();