diff options
author | 2021-02-10 02:02:26 +0000 | |
---|---|---|
committer | 2021-02-10 02:02:26 +0000 | |
commit | 79f163b4db710b84396b9a10f1aedd5c7aa6f357 (patch) | |
tree | cd09a5fbaa892f19530fda594b93feaf4a3f7e2b | |
parent | Merge pull request #1405 from python-discord/swfarnsworth/tag_messages (diff) | |
parent | Alphabetical sorting in config-default.yml (diff) |
Merge pull request #1411 from python-discord/internal-api-routing
-rw-r--r-- | bot/api.py | 2 | ||||
-rw-r--r-- | bot/constants.py | 1 | ||||
-rw-r--r-- | bot/exts/utils/ping.py | 2 | ||||
-rw-r--r-- | config-default.yml | 3 |
4 files changed, 5 insertions, 3 deletions
diff --git a/bot/api.py b/bot/api.py index d93f9f2ba..6ce9481f4 100644 --- a/bot/api.py +++ b/bot/api.py @@ -53,7 +53,7 @@ class APIClient: @staticmethod def _url_for(endpoint: str) -> str: - return f"{URLs.site_schema}{URLs.site_api}/{quote_url(endpoint)}" + return f"{URLs.site_api_schema}{URLs.site_api}/{quote_url(endpoint)}" async def close(self) -> None: """Close the aiohttp session.""" diff --git a/bot/constants.py b/bot/constants.py index 95e22513f..91e41e334 100644 --- a/bot/constants.py +++ b/bot/constants.py @@ -530,6 +530,7 @@ class URLs(metaclass=YAMLGetter): site: str site_api: str site_schema: str + site_api_schema: str # Site endpoints site_logs_view: str diff --git a/bot/exts/utils/ping.py b/bot/exts/utils/ping.py index 572fc934b..e62811b91 100644 --- a/bot/exts/utils/ping.py +++ b/bot/exts/utils/ping.py @@ -37,7 +37,7 @@ class Latency(commands.Cog): bot_ping = f"{bot_ping:.{ROUND_LATENCY}f} ms" try: - delay = await aioping.ping(URLs.site, family=socket.AddressFamily.AF_INET) * 1000 + delay = await aioping.ping(URLs.site_api, family=socket.AddressFamily.AF_INET) * 1000 site_ping = f"{delay:.{ROUND_LATENCY}f} ms" except TimeoutError: diff --git a/config-default.yml b/config-default.yml index d3b267159..d7415c821 100644 --- a/config-default.yml +++ b/config-default.yml @@ -335,7 +335,8 @@ keys: urls: # PyDis site vars site: &DOMAIN "pythondiscord.com" - site_api: &API !JOIN ["api.", *DOMAIN] + site_api: &API "pydis-api.default.svc.cluster.local" + site_api_schema: "http://" site_paste: &PASTE !JOIN ["paste.", *DOMAIN] site_schema: &SCHEMA "https://" site_staff: &STAFF !JOIN ["staff.", *DOMAIN] |