Skip to content

Commit 7a229d9

Browse files
committed
add comments
1 parent ee542dc commit 7a229d9

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

server/internal/background/activities/reap_functions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ func (r *ReapFlyApps) Do(ctx context.Context, req ReapFlyAppsRequest) (*ReapFlyA
7272
// Get all apps that should be reaped (keeping only the most recent N per project)
7373
appsToReap, err := repo.GetFlyAppsToReap(ctx, funcrepo.GetFlyAppsToReapParams{
7474
KeepCount: pgtype.Int8{Int64: r.keepCount, Valid: true},
75+
// Starting with a small batch size for now and we'll increase later on
76+
// after some observation.
7577
BatchSize: pgtype.Int8{Int64: 20, Valid: true},
7678
})
7779
if err != nil {

server/internal/background/deployments.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ func ProcessDeploymentWorkflow(ctx workflow.Context, params ProcessDeploymentWor
193193
string(attr.DeploymentIDKey), params.DeploymentID,
194194
)
195195
_, err = ExecuteProjectFunctionsReaperChildWorkflow(ctx, params.ProjectID)
196+
// Many deployments can run in parallel in a given project but only one
197+
// reaper should be active at a time, so we ignore the already started
198+
// error if we get that back.
196199
if err != nil && !temporal.IsWorkflowExecutionAlreadyStartedError(err) {
197200
logger.Error(
198201
"failed to start project-scoped functions reaper workflow",

0 commit comments

Comments
 (0)