Upgrade wait time changed
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 23 Feb 2005 10:23:58 +0000 (10:23 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 23 Feb 2005 10:23:58 +0000 (10:23 +0000)
sql/setup.in
src/server/core/package.cpp

index 46f78c8..5a9e854 100644 (file)
@@ -64,6 +64,8 @@ INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
        VALUES ('SMTPServer','localhost',1,0);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
        VALUES ('SMTPFromAddr','netxms@localhost',1,0);
        VALUES ('SMTPServer','localhost',1,0);
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
        VALUES ('SMTPFromAddr','netxms@localhost',1,0);
+INSERT INTO config (var_name,var_value,is_visible,need_server_restart)
+       VALUES ('AgentUpgradeWaitTime','600',1,0);
 
 
 /*
 
 
 /*
index 6926d1b..2e5f072 100644 (file)
@@ -149,6 +149,12 @@ static THREAD_RESULT THREAD_CALL DeploymentThread(void *pArg)
    BOOL bSuccess = FALSE;
    AgentConnection *pAgentConn;
    char *pszErrorMsg = "";
    BOOL bSuccess = FALSE;
    AgentConnection *pAgentConn;
    char *pszErrorMsg = "";
+   DWORD dwMaxWait;
+
+   // Read configuration
+   dwMaxWait = ConfigReadULong("AgentUpgradeWaitTime", 600);
+   if (dwMaxWait % 20 != 0)
+      dwMaxWait += 20 - (dwMaxWait % 20);
 
    // Prepare notification message
    msg.SetCode(CMD_INSTALLER_INFO);
 
    // Prepare notification message
    msg.SetCode(CMD_INSTALLER_INFO);
@@ -221,7 +227,7 @@ static THREAD_RESULT THREAD_CALL DeploymentThread(void *pArg)
 
                   // Wait for agent's restart
                   ThreadSleep(20);
 
                   // Wait for agent's restart
                   ThreadSleep(20);
-                  for(i = 20; i < 120; i += 20)
+                  for(i = 20; i < dwMaxWait; i += 20)
                   {
                      ThreadSleep(20);
                      if (pAgentConn->Connect())
                   {
                      ThreadSleep(20);
                      if (pAgentConn->Connect())