Home Page do Portal
Brasil, um país de todos

Changeset 581

Show
Ignorar:
Timestamp:
07/10/08 18:37:51
Autor:
rogeriolino@gmail.com
Mensagem:

Continuação: Corrigido fechamento indevido do programa durante boot da máquina.

Arquivos:

Legenda:

Não modificado
Adicionado
Removido
Modificado
Copiado
Movido
  • cacic/trunk/agente-linux/pycacic/src/cacic.py

    r579 r581  
    3737class Cacic: 
    3838     
    39     # seconds to sleep (socket errors) 
    40     SLEEP_TIME = 600 
    4139    VERSION = Reader.getPycacic()['version'] 
    4240     
     
    4543            CLog.appendLine(_l.get('pycacic'), _l.get('program_started')) 
    4644            print _l.get('welcome') 
    47             self.running = 0 
    4845            # abre conexao por socket 
    4946            self.setSocket() 
     
    5653                        
    5754        except socket.error: 
    58             CLog.appendLine(_l.get('pycacic'), '%s %s %s' % (_l.get('sleeping'), self.SLEEP_TIME, _l.get('seconds')))              
    59             time.sleep(SLEEP_TIME) 
     55            raise socket.error 
    6056             
    6157        except: 
     
    6965            if not self.isRoot(): 
    7066                raise Exception(_l.get('need_root')) 
    71             self.running = 1 
    7267            # Habilita o coletor de lixo do Python 
    7368            garbage_collector.enable()            
     
    216211        sys.exit(1) 
    217212     
    218      
    219     cacic = Cacic() 
     213    # seconds to sleep (socket errors) 
     214    SLEEP_TIME = 600 
     215     
    220216    while 1: 
    221217        try: 
    222             if not cacic.running: 
    223                 cacic.run() 
     218             
     219            cacic = Cacic() 
     220            cacic.run() 
    224221                 
    225222        except socket.error: 
    226             CLog.appendLine(_l.get('pycacic'), '%s %s %s' % (_l.get('sleeping'), cacic.SLEEP_TIME, _l.get('seconds')))              
     223            CLog.appendLine(_l.get('pycacic'), '%s %s %s' % (_l.get('sleeping'), SLEEP_TIME, _l.get('seconds')))              
    227224            time.sleep(SLEEP_TIME) 
    228225