def del_record_timeout(self, opt, view, domain, rtype): self.lock.acquire() oldobj = self.__del_item(self.type_err_record, opt, view, domain, rtype) if oldobj and not self.__del_or_not4del(oldobj['sent'], oldobj['regain']): oldobj['sent'] = 0 oldobj['regain'] = 1 oldobj['settime'] = get_time() self.desc[self.type_err_record].append(oldobj) self.__travel() self.lock.release()
def add_view_timeout(self, opt, view, mask): self.lock.acquire() oldobj = self.__del_item(self.type_err_view, opt, view, mask) if oldobj and not self.__del_or_not4add(oldobj['sent'], oldobj['regain']): self.desc[self.type_err_view].append(oldobj) else: obj = {'opt':opt, 'view':view, 'mask':mask, 'settime':get_time(), 'sent':0, 'regain':0} self.desc[self.type_err_view].append(obj) self.__travel() self.lock.release()
def del_db_error(self, desc): self.lock.acquire() if self.db_desc.has_key(desc): oldobj = self.__del_item(self.type_err_db, desc) if oldobj and not self.__del_or_not4del(oldobj['sent'], oldobj['regain']): oldobj['sent'] = 0 oldobj['regain'] = 1 oldobj['settime'] = get_time() self.desc[self.type_err_db].append(oldobj) self.__travel() self.lock.release()
def add_db_error(self, desc): self.lock.acquire() if self.db_desc.has_key(desc): oldobj = self.__del_item(self.type_err_db, desc) if oldobj and not self.__del_or_not4add(oldobj['sent'], oldobj['regain']): self.desc[self.type_err_db].append(oldobj) else: obj = {'desc':desc, 'settime':get_time(), 'sent':0, 'regain':0} self.desc[self.type_err_db].append(obj) self.__travel() self.lock.release()
def add_record_timeout(self, opt, view, domain, rtype): self.lock.acquire() oldobj = self.__del_item(self.type_err_record, opt, view, domain, rtype) if oldobj and not self.__del_or_not4add(oldobj['sent'], oldobj['regain']): self.desc[self.type_err_record].append(oldobj) else: obj = {'opt':opt, 'view':view, 'domain':domain, 'type':rtype, 'settime':get_time(), 'sent':0, 'regain':0} self.desc[self.type_err_record].append(obj) self.__travel() self.lock.release()
def del_view_timeout(self, opt, view, mask): self.lock.acquire() oldobj = self.__del_item(self.type_err_view, opt, view, mask) if oldobj and not self.__del_or_not4del(oldobj['sent'], oldobj['regain']): oldobj['sent'] = 0 oldobj['regain'] = 1 oldobj['settime'] = get_time() self.desc[self.type_err_view].append(oldobj) self.__travel() self.lock.release()
def add_db_error(self, desc): self.lock.acquire() if self.db_desc.has_key(desc): oldobj = self.__del_item(self.type_err_db, desc) if oldobj and not self.__del_or_not4add(oldobj['sent'], oldobj['regain']): self.desc[self.type_err_db].append(oldobj) else: obj = { 'desc': desc, 'settime': get_time(), 'sent': 0, 'regain': 0 } self.desc[self.type_err_db].append(obj) self.__travel() self.lock.release()
def add_view_timeout(self, opt, view, mask): self.lock.acquire() oldobj = self.__del_item(self.type_err_view, opt, view, mask) if oldobj and not self.__del_or_not4add(oldobj['sent'], oldobj['regain']): self.desc[self.type_err_view].append(oldobj) else: obj = { 'opt': opt, 'view': view, 'mask': mask, 'settime': get_time(), 'sent': 0, 'regain': 0 } self.desc[self.type_err_view].append(obj) self.__travel() self.lock.release()
def add_record_timeout(self, opt, view, domain, rtype): self.lock.acquire() oldobj = self.__del_item(self.type_err_record, opt, view, domain, rtype) if oldobj and not self.__del_or_not4add(oldobj['sent'], oldobj['regain']): self.desc[self.type_err_record].append(oldobj) else: obj = { 'opt': opt, 'view': view, 'domain': domain, 'type': rtype, 'settime': get_time(), 'sent': 0, 'regain': 0 } self.desc[self.type_err_record].append(obj) self.__travel() self.lock.release()