예제 #1
0
파일: app.py 프로젝트: retzkek/topology
 def get_topology(self) -> Topology:
     if self.topology.should_update():
         ok = self._update_topology_repo()
         self.topology.update(rg_reader.get_topology(
             self.topology_dir, self.get_contacts_data()),
                              bump_timestamp=ok)
     return self.topology.data
예제 #2
0
파일: models.py 프로젝트: marcioac/topology
    def get_topology(self) -> Topology:
        if self.topology.should_update():
            ok = self._update_topology_repo()
            if ok:
                self.topology.update(rg_reader.get_topology(self.topology_dir, self.get_contacts_data()))
            else:
                self.topology.try_again()

        return self.topology.data
예제 #3
0
파일: models.py 프로젝트: vbrik/topology
    def get_topology(self) -> Topology:
        if self.topology.should_update():
            ok = self._update_topology_repo()
            if ok:
                try:
                    self.topology.update(rg_reader.get_topology(self.topology_dir, self.get_contacts_data(), strict=self.strict))
                except Exception:
                    if self.strict:
                        raise
                    log.exception("Failed to update topology")
                    self.topology.try_again()
            else:
                self.topology.try_again()

        return self.topology.data
예제 #4
0
def _get_topology():
    global _topology
    if not _topology:
        _topology = get_topology("../topology", _get_contacts_data())
    return _topology