From 369cb121d45408ed4bdb1c283f9d9b430909aef0 Mon Sep 17 00:00:00 2001 From: Luke Lombardi Date: Thu, 18 Apr 2024 10:33:47 -0400 Subject: [PATCH] fix default function task expiration timeout --- internal/abstractions/function/function.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/abstractions/function/function.go b/internal/abstractions/function/function.go index 22d6e948e..cceee0280 100644 --- a/internal/abstractions/function/function.go +++ b/internal/abstractions/function/function.go @@ -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 { @@ -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