added log event for webhook response.
This commit is contained in:
parent
228d494c1a
commit
e257f15fcf
1 changed files with 1 additions and 0 deletions
|
|
@ -49,6 +49,7 @@ class Webhooks:
|
||||||
async with client.ClientSession() as session:
|
async with client.ClientSession() as session:
|
||||||
headers = req.get('headers', {}) if 'headers' in req else {}
|
headers = req.get('headers', {}) if 'headers' in req else {}
|
||||||
async with session.request(method=req.get('method', 'POST'), url=req.get('url'), json=item.__dict__, headers=headers) as response:
|
async with session.request(method=req.get('method', 'POST'), url=req.get('url'), json=item.__dict__, headers=headers) as response:
|
||||||
|
log.info(f"Sent {event=} {item.id=} to [{target.get('name')}] and responsed with [status: {response.status}].")
|
||||||
return {
|
return {
|
||||||
'url': req.get('url'),
|
'url': req.get('url'),
|
||||||
'status': response.status,
|
'status': response.status,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue