Compare commits

..

2 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
11e615565d Wrap optional output client init in try/except for best-effort initialization
Co-authored-by: seanthegeek <44679+seanthegeek@users.noreply.github.com>
Agent-Logs-Url: https://github.com/domainaware/parsedmarc/sessions/59241d4e-1b05-4a92-b2d2-e6d13d10a4fd
2026-03-20 21:14:37 +00:00
copilot-swe-agent[bot]
e3a6ea7e92 Initial plan 2026-03-20 21:08:41 +00:00

View File

@@ -832,13 +832,6 @@ def _init_output_clients(opts):
Raises:
ConfigurationError: If a required output client cannot be created.
"""
# Validate all required settings before creating any clients so that a
# ConfigurationError does not leave partially-created clients un-closed.
if opts.hec and (opts.hec_token is None or opts.hec_index is None):
raise ConfigurationError(
"HEC token and HEC index are required when using HEC URL"
)
clients = {}
if opts.save_aggregate or opts.save_forensic or opts.save_smtp_tls:
@@ -947,6 +940,10 @@ def _init_output_clients(opts):
)
if opts.hec:
if opts.hec_token is None or opts.hec_index is None:
raise ConfigurationError(
"HEC token and HEC index are required when using HEC URL"
)
verify = True
if opts.hec_skip_certificate_verification:
verify = False
@@ -1998,12 +1995,6 @@ def _main():
logger.info("Watching for email - Quit with ctrl-c")
while True:
# Re-check mailbox_watch in case a config reload disabled watch mode
if not opts.mailbox_watch:
logger.info(
"Mailbox watch disabled in reloaded configuration, stopping watcher"
)
break
try:
watch_inbox(
mailbox_connection=mailbox_connection,
@@ -2036,10 +2027,7 @@ def _main():
if not _reload_requested:
break
# Reload configuration — clear the flag first so that any new
# SIGHUP arriving while we reload will be captured for the next
# iteration rather than being silently dropped.
_reload_requested = False
# Reload configuration
logger.info("Reloading configuration...")
try:
# Build a fresh opts starting from CLI-only defaults so that