guard
This commit is contained in:
parent
f95461ad75
commit
c27e4dff80
|
|
@ -919,9 +919,9 @@ def process_message(domain: str, message: dict, receive_count: int) -> bool:
|
|||
parsed = BytesParser(policy=SMTPPolicy).parsebytes(raw_bytes)
|
||||
subject = parsed.get('Subject', '(no subject)')
|
||||
|
||||
# Bounce Header umschreiben
|
||||
# Bounce Header umschreiben (setzt auch is_bounce intern)
|
||||
is_bounce = is_ses_bounce_notification(parsed)
|
||||
parsed, modified = apply_bounce_logic(parsed, subject, worker_name)
|
||||
is_bounce = is_ses_bounce_notification(BytesParser(policy=SMTPPolicy).parsebytes(raw_bytes))
|
||||
|
||||
if modified:
|
||||
log(" ✨ Bounce detected & headers rewritten via DynamoDB", 'INFO', worker_name)
|
||||
|
|
@ -1268,7 +1268,16 @@ def start_health_server(worker: UnifiedWorker):
|
|||
# ENTRY POINT
|
||||
# ============================================
|
||||
|
||||
# Global flag to prevent double execution
|
||||
_worker_started = False
|
||||
|
||||
def main():
|
||||
global _worker_started
|
||||
if _worker_started:
|
||||
log("⚠ Worker already started, ignoring duplicate call", 'WARNING')
|
||||
return
|
||||
_worker_started = True
|
||||
|
||||
worker = UnifiedWorker()
|
||||
|
||||
def signal_handler(signum, frame):
|
||||
|
|
|
|||
Loading…
Reference in New Issue