v.0.11.3 api-server public port 8000
This commit is contained in:
@@ -7,8 +7,9 @@
|
||||
"dockerfile": "Dockerfile"
|
||||
},
|
||||
"runArgs": [
|
||||
"--network=dev-network",
|
||||
"--name=pico-client"
|
||||
// "--network=dev-network",
|
||||
"--name=pico-client",
|
||||
"--add-host", "j-agent-01:192.168.178.105"
|
||||
],
|
||||
// "image": "mcr.microsoft.com/devcontainers/python:1-3.12",
|
||||
// "image": "python:latest",
|
||||
|
||||
@@ -54,10 +54,10 @@ async def main(
|
||||
) -> None:
|
||||
# Run both tasks concurrently
|
||||
await asyncio.gather(
|
||||
sync_ntp_time_task(),
|
||||
weather_check_task(weather_checker),
|
||||
# sync_ntp_time_task(),
|
||||
# weather_check_task(weather_checker),
|
||||
api_server_check_task(api_server_checker),
|
||||
print_time_task(),
|
||||
# print_time_task(),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import urequests # type: ignore
|
||||
import json
|
||||
|
||||
BASE_API_URL: str = "http://api-server:8000"
|
||||
# BASE_API_URL: str = "http://api-server:8000"
|
||||
# BASE_API_URL: str = "http://j-agent-01:8000"
|
||||
BASE_API_URL: str = "http://192.168.178.105:8000"
|
||||
|
||||
|
||||
class API_Server_Checker:
|
||||
@@ -16,6 +18,7 @@ class API_Server_Checker:
|
||||
)
|
||||
print(f"query: {items_url}")
|
||||
|
||||
r: any
|
||||
try:
|
||||
r = urequests.get(items_url)
|
||||
print("Status-Code:", r.status_code)
|
||||
@@ -26,9 +29,12 @@ class API_Server_Checker:
|
||||
else:
|
||||
print("api-server error:", json_resp["error"]["message"])
|
||||
except OSError as e:
|
||||
print(f"api-server call failed: {e}")
|
||||
print("Network error:", e)
|
||||
except Exception as e:
|
||||
print("Error:", e)
|
||||
finally:
|
||||
r.close()
|
||||
if r:
|
||||
r.close()
|
||||
|
||||
def check(self, item_id: int):
|
||||
self._get_items(item_id)
|
||||
|
||||
Reference in New Issue
Block a user