small refactor

This commit is contained in:
shamoon 2024-12-01 17:16:43 -08:00
parent e68e8bb9b9
commit 3aac710a26
No known key found for this signature in database

View File

@ -991,6 +991,7 @@ def run_workflows(
f"Error occurred parsing webhook headers: {e}",
extra={"group": logging_group},
)
files = None
if action.webhook.include_document:
with open(document.source_path, "rb") as f:
files = {
@ -1001,13 +1002,7 @@ def run_workflows(
data=data,
files=files,
headers=headers,
)
else:
httpx.post(
action.webhook.url,
data=data,
headers=headers,
)
).raise_for_status()
except Exception as e:
logger.exception(
f"Error occurred sending webhook: {e}",