Skip to main content

Overview

Risk Legion uses scheduled tasks for maintenance, cleanup, and automated processes. These can be configured via system cron, Docker, or external schedulers.

Scheduled Tasks

Daily Tasks

Weekly Tasks

Monthly Tasks

Implementation

System Cron (EC2)

Docker-Based Cron

Using APScheduler

Task Scripts

Check Overdue Actions

Database Maintenance

Archive Audit Logs

External Schedulers

AWS EventBridge

For serverless scheduling:

GitHub Actions Scheduled Workflow

Monitoring Cron Jobs

Logging

Health Checks

Use Cronitor or Healthchecks.io:

Best Practices

  • Jobs should be safe to run multiple times
  • Use database transactions
  • Check for already-processed items
  • Catch and log exceptions
  • Send alerts on failures
  • Implement retry logic
  • Log job start and completion
  • Track job duration
  • Alert on job failures
  • Use dead man’s switch monitors
  • Run heavy jobs during off-peak hours
  • Batch large operations
  • Set appropriate timeouts