Changeset 581
- Timestamp:
- 07/10/08 18:37:51
- Arquivos:
-
- cacic/trunk/agente-linux/pycacic/src/cacic.py (modified) (5 diffs)
Legenda:
- Não modificado
- Adicionado
- Removido
- Modificado
- Copiado
- Movido
cacic/trunk/agente-linux/pycacic/src/cacic.py
r579 r581 37 37 class Cacic: 38 38 39 # seconds to sleep (socket errors)40 SLEEP_TIME = 60041 39 VERSION = Reader.getPycacic()['version'] 42 40 … … 45 43 CLog.appendLine(_l.get('pycacic'), _l.get('program_started')) 46 44 print _l.get('welcome') 47 self.running = 048 45 # abre conexao por socket 49 46 self.setSocket() … … 56 53 57 54 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 60 56 61 57 except: … … 69 65 if not self.isRoot(): 70 66 raise Exception(_l.get('need_root')) 71 self.running = 172 67 # Habilita o coletor de lixo do Python 73 68 garbage_collector.enable() … … 216 211 sys.exit(1) 217 212 218 219 cacic = Cacic() 213 # seconds to sleep (socket errors) 214 SLEEP_TIME = 600 215 220 216 while 1: 221 217 try: 222 if not cacic.running: 223 cacic.run() 218 219 cacic = Cacic() 220 cacic.run() 224 221 225 222 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'))) 227 224 time.sleep(SLEEP_TIME) 228 225
