Skip to content

Commit

Permalink
fix default function task expiration timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Lombardi committed Apr 18, 2024
1 parent 4cf530d commit 369cb12
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/abstractions/function/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const (
defaultFunctionContainerMemory int64 = 128
functionArgsExpirationTimeout time.Duration = 600 * time.Second
functionResultExpirationTimeout time.Duration = 600 * time.Second
functionDefaultTaskExpiration int = 3600 * 12 // 12 hours
)

type RunCFunctionService struct {
Expand Down Expand Up @@ -108,6 +109,9 @@ func (fs *RunCFunctionService) FunctionInvoke(in *pb.FunctionInvokeRequest, stre
}

func (fs *RunCFunctionService) invoke(ctx context.Context, authInfo *auth.AuthInfo, stubId string, payload *types.TaskPayload) (types.TaskInterface, error) {
policy := types.DefaultTaskPolicy
policy.Expires = time.Now().Add(time.Duration(functionDefaultTaskExpiration) * time.Second)

task, err := fs.taskDispatcher.SendAndExecute(ctx, string(types.ExecutorFunction), authInfo.Workspace.Name, stubId, payload, types.DefaultTaskPolicy)
if err != nil {
return nil, err
Expand Down

0 comments on commit 369cb12

Please sign in to comment.