mirror of
https://github.com/catspace-dev/unicheckbot.git
synced 2024-11-21 21:46:32 +03:00
don't push metrics if INFLUX_HOST not provided
This commit is contained in:
parent
ce2a6d5bdd
commit
f1577271df
|
@ -7,7 +7,9 @@ from ..config import (INFLUX_DB, INFLUX_HOST, INFLUX_PASSWORD, INFLUX_PORT,
|
|||
|
||||
|
||||
async def push_metric(measurement, tags: Dict, fields: Dict):
|
||||
try:
|
||||
if INFLUX_HOST is None:
|
||||
pass
|
||||
else:
|
||||
point = {
|
||||
'measurement': measurement,
|
||||
'tags': tags,
|
||||
|
@ -22,9 +24,6 @@ async def push_metric(measurement, tags: Dict, fields: Dict):
|
|||
mode='async'
|
||||
) as client:
|
||||
await client.write(point)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
pass
|
||||
|
||||
|
||||
async def push_api_request_status(status_code: int, endpoint: str):
|
||||
|
|
Loading…
Reference in New Issue
Block a user