File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export const FC_INSTANCE_EXEC_TIMEOUT: number = parseInt(
8282) ;
8383
8484export const FC_CONTAINER_ACCELERATED_TIMEOUT : number = parseInt (
85- process . env . FC_CONTAINER_ACCELERATED_TIMEOUT || '3 ' ,
85+ process . env . FC_CONTAINER_ACCELERATED_TIMEOUT || '40 ' ,
8686 10 ,
8787) ;
8888
Original file line number Diff line number Diff line change @@ -44,3 +44,10 @@ export const isFailedState = (ex) => {
4444 }
4545 return false ;
4646} ;
47+
48+ export const isFunctionStateWaitTimedOut = ( ex ) => {
49+ if ( _ . startsWith ( ex . message , 'retry to wait function state ok timeout' ) ) {
50+ return true ;
51+ }
52+ return false ;
53+ } ;
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ import {
5252 isSlsNotExistException ,
5353 isInvalidArgument ,
5454 isFailedState ,
55+ isFunctionStateWaitTimedOut ,
5556} from './error-code' ;
5657import { isCustomContainerRuntime , isCustomRuntime , computeLocalAuto } from './impl/utils' ;
5758import replaceFunctionConfig from './impl/replace-function-config' ;
@@ -79,10 +80,8 @@ export default class FC extends FC_Client {
7980 new Date ( ) . getTime ( ) - startTime > minute * 60 * 1000 ;
8081
8182 // 默认重试 3 min
82- let maxRetryContainerAcceleratedTime = FC_CONTAINER_ACCELERATED_TIMEOUT ;
83- if ( isAppCenter ( ) ) {
84- maxRetryContainerAcceleratedTime = FC_CONTAINER_ACCELERATED_TIMEOUT * 7 ;
85- }
83+ const maxRetryContainerAcceleratedTime = FC_CONTAINER_ACCELERATED_TIMEOUT ;
84+
8685 const retryContainerAccelerated = FC . isCustomContainerRuntime ( config . runtime ) ;
8786 // 部署镜像需要重试 3min, 直到达到!(State == Pending || LastUpdateStatus == InProgress)
8887 if ( retryContainerAccelerated ) {
@@ -308,7 +307,12 @@ export default class FC extends FC_Client {
308307 throw ex ;
309308 }
310309 retryInterval = 5 ;
311- } else if ( isAccessDenied ( ex ) || isInvalidArgument ( ex ) || isFailedState ( ex ) ) {
310+ } else if (
311+ isAccessDenied ( ex ) ||
312+ isInvalidArgument ( ex ) ||
313+ isFailedState ( ex ) ||
314+ isFunctionStateWaitTimedOut ( ex )
315+ ) {
312316 throw ex ;
313317 } else if ( retry > FC_DEPLOY_RETRY_COUNT ) {
314318 throw ex ;
You can’t perform that action at this time.
0 commit comments