debug
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
Rune Juhl Jacobsen 2023-02-19 21:52:36 +01:00
parent dddd7392b2
commit 3901791a6e

View file

@ -3,15 +3,13 @@ from aiohttp import web
from datetime import datetime
import os
homeserver = os.environ['MATRIX_HOMESERVER']
access_token = os.environ['MATRIX_ACCESS_TOKEN']
room = os.environ['MATRIX_ROOM']
_last_timestamp = 0
_counter = 0
def unique_number():
global _last_timestamp
global _counter
@ -43,6 +41,7 @@ async def handle_alert(request):
body = await request.json()
title = body['title']
status = body['status']
print(body)
await send_message(f'[{status}] {title}')
return web.Response(text='Ok')
@ -54,4 +53,5 @@ app.add_routes([
if __name__ == '__main__':
print('grafana_webhook_to_matrix.py starting')
web.run_app(app, host='0.0.0.0', port=8003)