def get_ha(self) -> Union[FailOverHA, BackupRequestHA]: name = self.url.get_param("haStrategy", "failover") if name == "failover": return FailOverHA(self.url) elif name == "backupRequestHA": return BackupRequestHA(self.url) raise ReferCfgError
def test_br(self, server, lb): ha = BackupRequestHA(lb.url) r = Request("", "sum", 1, 2) assert ha.call(r, lb).value == 3 lb.url.set_param("sum.retries", 5) assert ha.call(r, lb).value == 3
def get_ha(self): name = self.url.get_param("haStrategy", "failover") if name == "failover": return FailOverHA(self.url) elif name == "backupRequestHA": return BackupRequestHA(self.url)
def get_ha(self): name = self.url.get_param('haStrategy', 'failover') if name == 'failover': return FailOverHA(self.url) elif name == 'backupRequestHA': return BackupRequestHA(self.url)