mirror of
https://github.com/spalencsar/bearhub.git
synced 2026-07-07 00:04:15 +02:00
17 lines
367 B
Python
17 lines
367 B
Python
import logging
|
|
|
|
import requests
|
|
|
|
from bauh.api.http import HttpClient
|
|
|
|
|
|
def is_available(client: HttpClient, logger: logging.Logger) -> bool:
|
|
try:
|
|
client.get('https://google.com')
|
|
return True
|
|
except requests.exceptions.ConnectionError:
|
|
if logger:
|
|
logger.warning('Internet connection seems to be off')
|
|
return False
|
|
|