Skip to content

Commit

Permalink
Add support for function.paused_at in ScheduleBatchPayload/RetrieveAn…
Browse files Browse the repository at this point in the history
…dScheduleBatch (#1353)
  • Loading branch information
cdzombak committed May 13, 2024
1 parent 3af47ce commit 9ea844b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
13 changes: 7 additions & 6 deletions pkg/execution/batch/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,11 @@ type ScheduleBatchOpts struct {
}

type ScheduleBatchPayload struct {
BatchID ulid.ULID `json:"batchID"`
AccountID uuid.UUID `json:"acctID"`
WorkspaceID uuid.UUID `json:"wsID"`
AppID uuid.UUID `json:"appID"`
FunctionID uuid.UUID `json:"fnID"`
FunctionVersion int `json:"fnV"`
BatchID ulid.ULID `json:"batchID"`
AccountID uuid.UUID `json:"acctID"`
WorkspaceID uuid.UUID `json:"wsID"`
AppID uuid.UUID `json:"appID"`
FunctionID uuid.UUID `json:"fnID"`
FunctionVersion int `json:"fnV"`
FunctionPausedAt *time.Time `json:"fpAt,omitempty"`
}
15 changes: 8 additions & 7 deletions pkg/execution/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2528,13 +2528,14 @@ func (e executor) RetrieveAndScheduleBatch(ctx context.Context, fn inngest.Funct

key := fmt.Sprintf("%s-%s", fn.ID, payload.BatchID)
identifier, err := e.Schedule(ctx, execution.ScheduleRequest{
AccountID: payload.AccountID,
WorkspaceID: payload.WorkspaceID,
AppID: payload.AppID,
Function: fn,
Events: events,
BatchID: &payload.BatchID,
IdempotencyKey: &key,
AccountID: payload.AccountID,
WorkspaceID: payload.WorkspaceID,
AppID: payload.AppID,
Function: fn,
Events: events,
BatchID: &payload.BatchID,
IdempotencyKey: &key,
FunctionPausedAt: payload.FunctionPausedAt,
})
if err != nil {
span.SetStatus(codes.Error, err.Error())
Expand Down

0 comments on commit 9ea844b

Please sign in to comment.