Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add purge configuration and scheduled purger functionality #79

Merged
merged 7 commits into from
Nov 8, 2024

Conversation

fujiwara
Copy link
Collaborator

@fujiwara fujiwara commented Nov 7, 2024

This PR adds a scheduled purge feature.

When a purge setting is available, mirage-ecs runs a purge task at the specified schedule. There is no need to call POST /api/purge from external.


purge section configures purge settings.

purge:
  schedule: "13 4 * * ? *" # cron expression
  request:
    duration: 86400
    excludes:
      - foo
      - bar
    exclude_tags:
      - "branch:preview"
    exclude_regexp: "^(foo|bar)"

The schedule is a cron expression to run the purge task.

  • mirage-ecs runs the purge task at the specified schedule.
  • The expression is the same as the Amazon EventBridge cron().
    • See the document of Cron expressions for details.
    • Timezone is depends on the ECS task timezone.

The request section is the same as the /api/purge API. See API Documents.

@fujiwara fujiwara marked this pull request as ready for review November 7, 2024 07:46
@fujiwara fujiwara merged commit 5876e1a into v2 Nov 8, 2024
4 checks passed
@fujiwara fujiwara deleted the feature/purge-internal branch November 8, 2024 05:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant