/[LeafOK_CVS]/innwebd/service.cpp
ViewVC logotype

Diff of /innwebd/service.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.5 by sysadm, Tue Aug 10 19:55:57 2004 UTC Revision 1.9 by sysadm, Fri Apr 11 17:14:49 2008 UTC
# Line 1  Line 1 
1  /*******************************************************/  /*******************************************************/
2  /*                                                     */  /*                                                     */
3  /*  LeafOK Innbbsd                                     */  /*  LeafOK Innbbsd                                     */
 /*  Copyright (C) LeafOK.com, 2003-2004                */  
4  /*                                                     */  /*                                                     */
5  /*  Programmed by Leaf                                 */  /*  Copyright (C) LeafOK.com, 2003-2008                */
 /*  E-mail:leaflet@leafok.com  QQ:6049044              */  
6  /*                                                     */  /*                                                     */
7  /*  http://bbs.leafok.com                              */  /*  http://www.leafok.com                              */
 /*  http://bbs.leafok.net                              */  
 /*  http://bbs.fenglin.info                            */  
8  /*                                                     */  /*                                                     */
9  /*******************************************************/  /*******************************************************/
10    
# Line 31  service::~service(void) Line 27  service::~service(void)
27    
28  void service::Run()  void service::Run()
29  {  {
30            int startup_err_count = 0;
31    
32          this->ctrld.StartupDelay();          this->ctrld.StartupDelay();
33    
34          this->ctrld.InitThreadPool();          this->ctrld.InitThreadPool();
35    
36          while (this->m_bIsRunning)          while (this->m_bIsRunning)
37          {          {
38                  if (this->ctrld.begin() ==0)                  if (this->ctrld.begin() == 0)
39                  {                  {
40                          syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl;                          syslog << logfile::log_head << "Begin CONTROLD ... OK" << endl;
41    
# Line 46  void service::Run() Line 44  void service::Run()
44                          break;                          break;
45                  }                  }
46                  syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl;                  syslog << logfile::log_head << "Begin CONTROLD ... Failed" << endl;
47                  Sleep(1000 * 60);  
48                    if (startup_err_count++ > 5)
49                    {
50                            this->m_bIsRunning = false;
51                            break;
52                    }
53    
54                    Sleep(1000 * 60 * 5);
55          }          }
56    
57          while (this->m_bIsRunning && this->ctrld.IsRunning())          while (this->m_bIsRunning && this->ctrld.IsRunning())


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1