@@ -394,22 +394,21 @@ class Scf {
394394 let funcInfo = await this . getFunction ( namespace , inputs . name ) ;
395395 if ( ! funcInfo ) {
396396 await this . createFunction ( inputs ) ;
397- funcInfo = await this . getFunction ( namespace , inputs . name ) ;
398397 } else {
399398 await this . updateFunctionCode ( inputs , funcInfo ) ;
400399
401400 // should check function status is active, then continue
402401 await this . isOperationalStatus ( namespace , inputs . name ) ;
403402
404403 await this . updatefunctionConfigure ( inputs , funcInfo ) ;
405-
406- // after updating function, get latest function info
407- funcInfo = await this . getFunction ( namespace , inputs . name ) ;
408404 }
409405
410406 // should check function status is active, then continue
411407 await this . isOperationalStatus ( namespace , inputs . name ) ;
412408
409+ // after create/update function, get latest function info
410+ funcInfo = await this . getFunction ( namespace , inputs . name ) ;
411+
413412 const outputs = funcInfo ;
414413 if ( inputs . publish ) {
415414 const { FunctionVersion } = await this . publishVersion ( {
@@ -506,6 +505,10 @@ class Scf {
506505
507506 await this . deleteFunction ( namespace , functionName ) ;
508507
508+ try {
509+ await this . isOperationalStatus ( namespace , functionName ) ;
510+ } catch ( e ) { }
511+
509512 if ( inputs . Triggers ) {
510513 for ( let i = 0 ; i < inputs . Triggers . length ; i ++ ) {
511514 if ( inputs . Triggers [ i ] . serviceId ) {
@@ -521,6 +524,8 @@ class Scf {
521524 }
522525
523526 console . log ( `Remove function ${ functionName } and it's triggers success` ) ;
527+
528+ return true ;
524529 }
525530
526531 async invoke ( inputs = { } ) {
0 commit comments