Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh
10 linesCodeBlameRaw
1-- A sandbox build's seconds are charged once billing confirms them
2-- (`build_charged_at`); until then the sweep tries again, so a build is
3-- never left uncharged by billing being briefly unreachable. Billing
4-- records each build's reference (`deploy/<id>`) once, so a try whose
5-- answer was lost cannot charge it twice. Builds that finished before this
6-- were charged, or not, as they finished, and are not tried again.
7ALTER TABLE deployments ADD COLUMN build_charged_at TEXT;
8UPDATE deployments SET build_charged_at = 'before: charged as it finished' WHERE build_seconds IS NOT NULL;
9CREATE INDEX IF NOT EXISTS deployments_build_uncharged ON deployments (finished_at)
10 WHERE build_charged_at IS NULL AND build_seconds > 0;