Skip to content

Conversation

@disintegrator
Copy link
Contributor

@disintegrator disintegrator commented Nov 5, 2025

This change implements a background worker that periodically checks for and reaps unused Fly.io applications associated with function deployments that are no longer active. For now, we will retain all apps created in the past 3 deployments of every Gram project.

The goal of this work is to keep fly machine provisioning on a slower growth trajectory so we may accommodate more Gram Functions users.

@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

⚠️ No Changeset found

Latest commit: df70695

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Nov 5, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
gram Ready Ready Preview Comment Nov 10, 2025 4:21pm
gram-docs-redirect Ready Ready Preview Comment Nov 10, 2025 4:21pm
gram-landing-redirect Ready Ready Preview Comment Nov 10, 2025 4:21pm

@github-actions
Copy link
Contributor

github-actions bot commented Nov 5, 2025

Squawk Report

✅ 0 violations across 1 file(s)


server/migrations/20251110161934_fly-apps-reap-state.sql

-- atlas:txmode none

-- Drop index "fly_apps_project_deployment_function_key" from table: "fly_apps"
DROP INDEX CONCURRENTLY "fly_apps_project_deployment_function_key";
-- Modify "fly_apps" table
ALTER TABLE "fly_apps" ADD COLUMN "reap_error" text NULL;
-- Create index "fly_apps_project_deployment_function_active_key" to table: "fly_apps"
CREATE UNIQUE INDEX CONCURRENTLY "fly_apps_project_deployment_function_active_key" ON "fly_apps" ("project_id", "deployment_id", "function_id") WHERE (reaped_at IS NULL);
-- Create index "fly_apps_reaper_idx" to table: "fly_apps"
CREATE INDEX CONCURRENTLY "fly_apps_reaper_idx" ON "fly_apps" ("project_id", "created_at" DESC) WHERE ((status = 'ready'::text) AND (reaped_at IS NULL));

✅ Rule Violations (0)

No violations found.


📚 More info on rules

⚡️ Powered by Squawk (1.6.1), a linter for PostgreSQL, focused on migrations

This change implements a background worker that periodically checks for
and reaps unused Fly.io applications associated with function
deployments that are no longer active. For now, we will retain all apps
created in the past 3 deployments of every Gram project.
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.

2 participants