File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ const CONFIGS = {
22 defaultNamespace : 'default' ,
33 defaultMemorySize : 128 ,
44 defaultTimeout : 3 ,
5+ waitStatus : [ 'Creating' , 'Updating' , 'Publishing' ] ,
56} ;
67
78module . exports = CONFIGS ;
Original file line number Diff line number Diff line change @@ -90,9 +90,10 @@ class Scf {
9090 // because craeting function is asynchronous
9191 async checkStatus ( namespace , functionName ) {
9292 console . log ( `Checking function ${ functionName } status ...` ) ;
93- let status = 'Updating' ;
93+ const initialInfo = await this . getFunction ( namespace , functionName ) ;
94+ let status = initialInfo . Status ;
9495 let times = 200 ;
95- while ( ( status === 'Updating' || status === 'Creating' ) && times > 0 ) {
96+ while ( CONFIGS . waitStatus . indexOf ( status ) !== - 1 && times > 0 ) {
9697 const tempFunc = await this . getFunction ( namespace , functionName ) ;
9798 status = tempFunc . Status ;
9899 await sleep ( 300 ) ;
You can’t perform that action at this time.
0 commit comments