Skip to content

Daily Settlement Cron Job & Inactive Session Cleanup #6

Description

@Luluameh
  • Difficulty: Medium
  • Labels: backend, cron, escrow

Description

Sometimes users forget to close a video call session, leaving funds locked in escrow indefinitely. We need a automated cron job that periodically checks for inactive/zombie sessions and marks them for arbitration or automatic closure.

Technical Scope & Steps

  1. Install node-cron or set up a task scheduler.
  2. Write a job that queries for active sessions where the last expert heartbeat is older than 1 hour.
  3. Transition their database status to inactive_pending_settlement.
  4. Send an alert or log an administrative flag for dispute resolution.

Acceptance Criteria

  • Job executes successfully on the defined schedule.
  • Inactive sessions are cleanly identified without impacting active sessions.
  • Detailed log output records every session updated by the automated job.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions