ferrero-opentext/Python-Version/scripts/shared
nickviljoen e1f15ea632 Add A1 retry logic and orchestrator off-hours cadence
Feature 1: A1→A2 Empty Folder Retry Logic
- Track retry attempts (max 3) for campaigns with no master assets
- Mark campaigns as permanently failed after 3 attempts
- Stop processing and sending emails for permanently failed campaigns
- Two new email templates: retry notification and permanent failure
- Database migration adds 4 new columns to campaign_status table
- Comprehensive documentation in A1_RETRY_LOGIC.md

Feature 2: Orchestrator Off-Hours Cadence
- Add 30 minutes to all task intervals during off-hours
- Off-hours: 10 PM - 5 AM weekdays + all day Saturday/Sunday
- Tasks only run at minutes 0 and 30 during off-hours
- Configurable and easy to enable/disable
- Daily Report (7 PM) remains unchanged

Files changed:
- NEW: database/migrations/003_add_a1_retry_tracking.sql
- NEW: MARKDOWN_DOCS/A1_RETRY_LOGIC.md
- MODIFIED: scripts/shared/database.py (added 3 methods)
- MODIFIED: scripts/a1_to_a2_box_uploader.py (added retry logic)
- MODIFIED: scripts/shared/notifier.py (added 2 templates)
- MODIFIED: scripts/orchestrator-prod.py (added off-hours config)
- MODIFIED: RUN_ORCHESTRATOR.md (added off-hours docs)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-31 17:38:57 +02:00
..
__pycache__ feat: Add systemd services and timers for daily and weekly database backups, introduce a token retrieval script, and update the backup guide documentation. 2025-12-01 22:19:24 -05:00
__init__.py Start Python automation - Foundation components 2025-10-30 16:38:26 -04:00
box_client.py Implement Master Tracking ID validation for A2-A3 uploads 2025-12-06 17:21:38 -05:00
common.py Implement robust Box name sanitization in shared/common.py 2025-12-01 15:23:01 -05:00
config_loader.py Enhancement: Add environment-specific configurations and metadata improvements 2026-01-28 20:41:21 +02:00
dam_client.py Fix: Prevent DAM folder creation attempts causing timeouts 2026-01-30 10:34:53 +02:00
database.py Add A1 retry logic and orchestrator off-hours cadence 2026-01-31 17:38:57 +02:00
filename_parser.py Update filename parser to V2.1 structure with new field positions 2025-11-13 13:41:19 -05:00
filename_parser_v1_backup.py Update filename parser to V2.1 structure with new field positions 2025-11-13 13:41:19 -05:00
metadata_extractor_mvp.py Enhancement: Add environment-specific configurations and metadata improvements 2026-01-28 20:41:21 +02:00
metadata_extractor_mvp.py.backup PPR Environment: Use SIMPLE metadata structure for tabular fields 2026-01-23 16:52:50 +02:00
metadata_extractor_mvp_PROD.py PPR Environment: Use SIMPLE metadata structure for tabular fields 2026-01-23 16:52:50 +02:00
notifier.py Add A1 retry logic and orchestrator off-hours cadence 2026-01-31 17:38:57 +02:00