From 598def479d4ca7316340b56381869602d6a0746f Mon Sep 17 00:00:00 2001 From: Shane Jaroch Date: Wed, 14 Feb 2024 10:41:49 -0500 Subject: [PATCH] wip URLS_API (try all available hosts) --- ntclient/services/api/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ntclient/services/api/__init__.py b/ntclient/services/api/__init__.py index c75d952..e5d6990 100644 --- a/ntclient/services/api/__init__.py +++ b/ntclient/services/api/__init__.py @@ -8,6 +8,12 @@ Created on Tue Feb 13 14:28:20 2024 import requests URL_API = "https://api.nutra.tk" +# TODO: try all of these; cache (save in prefs.json) the one which works first +URLS_API = ( + "https://api.nutra.tk", + "https://216.218.216.163/api", # prod + "https://216.218.228.93/api", # dev +) REQUEST_READ_TIMEOUT = 18 REQUEST_CONNECT_TIMEOUT = 5 @@ -40,6 +46,7 @@ class ApiClient: req.raise_for_status() return dict(req.json()) + # TODO: move this outside class; support with host iteration helper method def post_bug(self, bug: tuple) -> None: """Post a bug report to the developer.""" print("posting bug report...") -- 2.52.0