-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
Phase 3: Remove Legacy Cron-Based Background Job System
Overview
Remove the legacy cron-based background job system after successful migration to Celery. This cleanup phase eliminates redundant infrastructure and completes the modernization of the background job system.
Scope
This issue focuses exclusively on removing the legacy cron system files and references. It does NOT include any task migration work (handled in Phase 2) or infrastructure setup (handled in Phase 1).
Current Legacy System Components
Cron Infrastructure Files (To Be Removed)
.contrib/docker/cron/set_crontab.sh- Cron job definition script.contrib/docker/cron/run_locked.sh- File locking wrapper for cron jobs- Cron-related Docker service configurations (if any)
- Environment variables for cron scheduling (COURT_SESSION_PARSER_SCHEDULE, etc.)
Docker Configuration Updates
- Remove cron-related services from
docker-compose.yml(if present) - Remove cron-related environment variables
- Update Docker build process if cron was part of base image
- Remove cron-related volumes or mounts
Documentation Updates
- Remove cron-related documentation from
CLAUDE.md - Remove cron-related make commands (if any)
- Update development workflow documentation to reflect Celery-only approach
Implementation Tasks
1. Legacy File Removal
- Remove
.contrib/docker/cron/set_crontab.sh - Remove
.contrib/docker/cron/run_locked.sh - Remove entire
.contrib/docker/cron/directory if no other files remain - Remove cron-related Docker configurations
2. Environment Variable Cleanup
- Remove cron schedule environment variables:
EVENT_REMINDERS_SCHEDULEOLD_CASES_REMINDER_SCHEDULECOURT_SESSION_PARSER_SCHEDULECLEARSESSIONS_SCHEDULE
- Update Docker environment files
- Remove from
docker-compose.ymlenvironment sections
3. Docker Configuration Cleanup
- Remove cron service definitions from
docker-compose.yml(if any) - Remove cron-related volumes or bind mounts
- Update base Docker images if cron was installed
- Remove cron-related health checks or dependencies
4. Documentation Updates
- Update
CLAUDE.mdto remove cron-related commands - Update development workflow documentation
- Remove references to file locking mechanisms
- Update troubleshooting sections that mentioned cron
5. Code References Cleanup
- Search for and remove any code comments referencing cron system
- Remove unused imports related to file locking (if any)
- Clean up any configuration that was cron-specific
Files to Remove/Modify
Files to Remove
.contrib/docker/cron/set_crontab.sh.contrib/docker/cron/run_locked.sh.contrib/docker/cron/directory (if empty after removal)
Files to Modify
docker-compose.yml- Remove cron-related configurationsdocker-compose.override.yml- Remove cron overrides if anyCLAUDE.md- Remove cron documentation, update with Celery-only workflow- Docker environment files - Remove cron schedule variables
Makefile- Remove cron-related make targets if any
Files NOT to Modify
- Management commands (kept for manual execution capability)
- Django settings (Celery configuration only)
- Application code (no changes needed)
Dependencies
- BLOCKED BY: All Phase 2 task migration issues must be completed and stable:
- Migrate run_court_session_parser to Celery Task #1830 - Migrate run_court_session_parser to Celery Task
- Migrate send_event_reminders to Celery Task #1831 - Migrate send_event_reminders to Celery Task
- Migrate send_old_cases_reminder to Celery Task #1832 - Migrate send_old_cases_reminder to Celery Task
- Migrate Django clearsessions to Celery Task #1833 - Migrate Django clearsessions to Celery Task
- REQUIRES: Verification that Celery tasks are running successfully in production
- PARENT: Part of overall Celery migration project
Safety Requirements
Pre-Cleanup Verification
- Confirm all Celery tasks are running successfully for at least 1 week
- Verify Celery beat scheduling is working correctly
- Confirm no critical failures in Celery task execution
- Validate that all original cron job functions are preserved in Celery
Rollback Preparation
- Create backup of all cron-related files before deletion
- Document exact cron schedules for emergency restoration
- Keep rollback procedure for re-enabling cron system if needed
- Test rollback procedure in development environment
Related Issues
Dependencies (Must Be Completed First)
- BLOCKED BY: Migrate run_court_session_parser to Celery Task #1830 - Migrate run_court_session_parser to Celery Task
- BLOCKED BY: Migrate send_event_reminders to Celery Task #1831 - Migrate send_event_reminders to Celery Task
- BLOCKED BY: Migrate send_old_cases_reminder to Celery Task #1832 - Migrate send_old_cases_reminder to Celery Task
- BLOCKED BY: Migrate Django clearsessions to Celery Task #1833 - Migrate Django clearsessions to Celery Task
Infrastructure Issues
- FOLLOWS: Phase 1: Celery Infrastructure Setup #1828 - Phase 1: Celery Infrastructure Setup (completed)
- FOLLOWS: Phase 2: Background Task Migration to Celery (Umbrella Issue) #1829 - Phase 2: Background Task Migration to Celery (completed)
This issue represents the final cleanup phase after successful Celery migration.
Acceptance Criteria
- All cron-related files are removed from the repository
- No cron-related references remain in Docker configurations
- Documentation reflects Celery-only background job system
- Cron environment variables are cleaned up
- Development workflow no longer mentions cron system
- All background jobs continue running successfully via Celery
- No regression in background job functionality
- Clean git history with appropriate commit message
Verification Steps
-
grep -r "cron" .returns no configuration references (excluding this issue) -
grep -r "SCHEDULE" .returns only Celery-related configurations - Docker containers start successfully without cron dependencies
- All background jobs execute on schedule via Celery beat
- No file locking mechanisms remain in the codebase
Non-Overlapping Scope Clarification
This issue is distinct from existing issues:
- Phase 1 (Phase 1: Celery Infrastructure Setup #1828): Infrastructure setup - does NOT include cron removal
- Phase 2 (Phase 2: Background Task Migration to Celery (Umbrella Issue) #1829): Task migration - does NOT include cron cleanup
- Task Issues (Migrate run_court_session_parser to Celery Task #1830-1833): Individual task migration - do NOT remove cron files
- This Issue: Pure cleanup of legacy cron system after migration is complete
Timeline
This issue should be executed only after:
- All Phase 2 task migrations are completed
- Celery tasks have been running successfully for at least 1 week in production
- Team confidence in Celery system stability is high
Success Metrics
- Clean Codebase: No legacy cron references remain
- Simplified Infrastructure: Reduced Docker complexity
- Maintained Functionality: All background jobs continue working via Celery
- Documentation Accuracy: Development docs reflect current (Celery-only) system
References
- Current cron system:
.contrib/docker/cron/ - Legacy documentation in
CLAUDE.md(cron sections) - Docker configurations with cron environment variables
Metadata
Metadata
Assignees
Labels
No labels