File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 11const { Capi } = require ( '@tencent-sdk/capi' ) ;
2+ const { waitResponse } = require ( '@ygkit/request' ) ;
23const capis = require ( './apis/apis' ) ;
34const apis = require ( './apis' ) ;
45
6+ // timeout 2 minutes
7+ const TIMEOUT = 2 * 60 * 1000 ;
8+
59class Layer {
610 constructor ( credentials = { } , region ) {
711 this . region = region || 'ap-guangzhou' ;
@@ -52,6 +56,13 @@ class Layer {
5256 // publish layer
5357 console . log ( `Creating layer ${ inputs . name } ` ) ;
5458 const version = await apis . publishLayer ( this . capi , layerInputs ) ;
59+ // loop for active status
60+ await waitResponse ( {
61+ callback : async ( ) => this . getLayerDetail ( inputs . name , version ) ,
62+ targetProp : 'Status' ,
63+ targetResponse : 'Active' ,
64+ timeout : TIMEOUT ,
65+ } ) ;
5566 console . log ( `Created layer: ${ inputs . name } , version: ${ version } successful` ) ;
5667 outputs . version = version ;
5768
You can’t perform that action at this time.
0 commit comments