Skip to content

Add cleanup strategy for old database triggers #433

@coderabbitai

Description

@coderabbitai

Description

Add a lifecycle/retention strategy for old triggers in the DatabaseTriggers collection to prevent unbounded growth.

Proposed Solution

Implement one of the following cleanup strategies:

  • Add a TTL (Time To Live) field like expires_at to automatically remove old documents
  • Implement periodic purge of CANCELLED/TRIGGERED triggers older than N days
  • Add background job to clean up old trigger records

Context

This enhancement was identified during code review of PR #428 which introduces the trigger system. Without proper cleanup, the DatabaseTriggers collection could grow indefinitely as triggers are executed and completed.

Related Issues

Backlinks

Requested by: @NiveditJain

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions