Skip to content

Scheduled Maintenance Workflows

Introduction

The Scheduled Maintenance Workflows are a set of scheduled workflows designed to automate routine maintenance and monitoring tasks within the system. These workflows are implemented in Temporal and serve as a modern replacement for traditional cron jobs. They are organized under the grepsr-cron.jv9o7 namespace and are configured to run daily, ensuring consistent and reliable execution of critical tasks.

By leveraging Temporal's robust scheduling capabilities, these workflows provide enhanced reliability, scalability, and visibility compared to conventional cron jobs. They are essential for maintaining system efficiency, cleaning up outdated data, and monitoring key metrics to ensure smooth operations.

Note

Daily Run Workflow

The Daily Run Workflow is a scheduled temporal workflow designed to run once every day. It performs the following activities to maintain system efficiency and data cleanliness:

  1. Cleaning Task History
    Deletes completed and failed records from the vt_task_history table that are older than 3 months from today.

  2. Cleaning Task Queue
    Deletes completed and failed records from the vt_task_queue table that are older than 3 months from today.

  3. Clean Provisioning and Initializing Histories
    Identifies records stuck in "initializing" or "provisioning" status for more than 5 hours and updates their status to "failed."

  4. Clean Old Proxy Usage
    Deletes proxy usage data that is older than 1 year.

  5. Update Service Categorization
    Updates the categorization of services/reports to ensure accurate and up-to-date classifications.

This workflow ensures the system remains optimized by removing outdated data and resolving stalled processes.


InsertHistoryIndexWorkflow

The InsertHistoryIndexWorkflow is a scheduled workflow that runs every third hour. It ensures the proper indexing of data for visibility and performance in the platform.

The workflow includes an activity that adds an index named vt_extractor_history_date_index to the vt_extractor_history table. If the index is not added, the runs cannot be viewed or tracked in the platform.

This workflow is critical for maintaining data accessibility and ensuring smooth platform operations.


CleanOldSupportingFilesWorkflow

The CleanOldSupportingFilesWorkflow is a scheduled workflow that runs every fourth hour. It includes an activity to clean up old supporting files located in /mnt/data/vortex-backend with the name supporting_files.


CleanContentFilesWorkflow

The CleanContentFilesWorkflow is a scheduled workflow that runs every third hour. It includes an activity to clean up content files located in /mnt/data/vortex-backend with the name content_files.


CleanTempExportsWorkflow

The CleanTempExportsWorkflow is a scheduled workflow that runs daily at 6 AM. It includes an activity to delete temporary files for export-service and delivery-service located in the following directories: - /mnt/data/phoenix-export-service/ - /mnt/data/phoenix-delivery-service/


CheckOverdueWorkflow

The CheckOverdueWorkflow is a scheduled workflow that runs every 15 minutes. It includes an activity to check (via GET requests) the URL:
https://rpt-bac.prd.int.grepsr.net/cwl_dash/save/overdue.


CheckCrawlerMetricsWorkflow

The CheckCrawlerMetricsWorkflow is a scheduled workflow that runs every 15 minutes. It includes an activity to check (via GET requests) the URL:
reports.grepsr-infra:3000/cwl_dash/save/metrics.


These workflows ensure the system remains clean, efficient, and up-to-date by performing regular maintenance and monitoring tasks.

Links:

Repo: https://bitbucket.org/grepsr/phoenix-system-status/src/master/