Skip to content

Commit

Permalink
feat(aptly): increase timeouts, retry three times
Browse files Browse the repository at this point in the history
  • Loading branch information
fyhertz committed Feb 6, 2023
1 parent 49ee202 commit ac2abc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/wakemebot/aptly.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ def client_factory(
client_key_path = Path(base_directory) / "client.key"
client_key_path.write_bytes(base64.b64decode(client_key))
transport = httpx.HTTPTransport(
retries=2,
retries=3,
cert=(str(client_cert_path), str(client_key_path)),
verify=str(ca_cert_path),
)
yield httpx.Client(transport=transport, base_url=server_url, timeout=60)
yield httpx.Client(transport=transport, base_url=server_url, timeout=120)


def parse_packages(data: List[str]) -> List[Package]:
Expand Down
9 changes: 4 additions & 5 deletions src/wakemebot/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
from mkdocs.structure.pages import Page
from mkdocs.structure.toc import AnchorLink, TableOfContents

from .apt import parse_repository
from .badges import Badge
from wakemebot.apt import parse_repository
from wakemebot.badges import Badge

filters = {"sample": sample}

environment = Environment()
environment.filters.update(filters)


class WakeMeDocPlugin(BasePlugin):
class WakeMeDocPlugin(BasePlugin): # type: ignore[type-arg]
config_scheme = (
("repository_url", Type(str, default="http://deb.wakemeops.com/wakemeops/")),
("distribution", Type(str, default="stable")),
Expand Down Expand Up @@ -120,11 +120,10 @@ def on_page_context(
features.remove("toc.integrate")

# Use toc to list package versions on package pages
if (package := self.packages.get(page.title, None)) is not None:
if page.title and (package := self.packages.get(page.title, None)) is not None:
items = [AnchorLink(v, v, 0) for v in package.versions.keys()]
page.toc = TableOfContents(items)
config["mdx_configs"]["toc"] = {"title": "Versions"}
page.toc.title = "Versions"
else:
config["mdx_configs"].pop("toc", None)

Expand Down

0 comments on commit ac2abc9

Please sign in to comment.