|
@@ -304,12 +304,12 @@ class AgentOperService:
|
|
|
_key = CENTER_AGENT_LIVE_CNT % SAAS_ID
|
|
|
pre_time = self.redis_handler.redis.get(_key)
|
|
|
if not pre_time or not _members or len(_members) == 0:
|
|
|
- value = datetime.now().timestamp()
|
|
|
- self.redis_handler.redis.set(_key, value, ex=60*60, nx=True)
|
|
|
+ _value = datetime.now().timestamp()
|
|
|
+ self.redis_handler.redis.set(_key, _value, ex=60*60, nx=True)
|
|
|
else:
|
|
|
- diff = datetime.now().timestamp() - float(pre_time)
|
|
|
- if diff > self.agent_serial_live_expire:
|
|
|
- self.logger.info('check_agent_live_daemon, members=%s, diff=%s, pre_val=%s', (len(_members) if _members else 0), diff, pre_time)
|
|
|
+ _diff = datetime.now().timestamp() - float(pre_time)
|
|
|
+ if _diff > self.agent_serial_live_expire:
|
|
|
+ self.logger.info('check_agent_live_daemon, members=%s, diff=%s, pre_time=%s', (len(_members) if _members else 0), _diff, pre_time)
|
|
|
self.logger.warn('WARING::live agent count less than 1 serial ten minutes')
|
|
|
self.data_handle_server.create_warning_record(1, '10分钟空岗报警')
|
|
|
self.redis_handler.redis.delete(_key)
|