File tree Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Expand file tree Collapse file tree 2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change 12
12
"license" : " MIT" ,
13
13
"dependencies" : {
14
14
"download" : " ^8.0.0" ,
15
- "tencent-component-toolkit" : " ^1.12.3 " ,
15
+ "tencent-component-toolkit" : " ^1.12.6 " ,
16
16
"type" : " ^2.0.0"
17
17
}
18
18
}
Original file line number Diff line number Diff line change @@ -64,15 +64,25 @@ class ServerlessComponent extends Component {
64
64
...outputs [ curRegion ]
65
65
}
66
66
67
- if ( scfOutput . LastVersion ) {
68
- outputs [ curRegion ] . lastVersion = scfOutput . LastVersion
69
- this . state . lastVersion = scfOutput . LastVersion
67
+ // default version is $LATEST
68
+ outputs [ curRegion ] . lastVersion = scfOutput . LastVersion
69
+ ? scfOutput . LastVersion
70
+ : this . state . lastVersion || '$LATEST'
71
+
72
+ // default traffic is 1.0, it can also be 0, so we should compare to undefined
73
+ outputs [ curRegion ] . traffic = scfOutput . Traffic
74
+ ? scfOutput . Traffic
75
+ : this . state . traffic !== undefined
76
+ ? this . state . traffic
77
+ : 1
78
+
79
+ if ( outputs [ curRegion ] . traffic !== 1 && scfOutput . ConfigTrafficVersion ) {
80
+ outputs [ curRegion ] . configTrafficVersion = scfOutput . ConfigTrafficVersion
81
+ this . state . configTrafficVersion = scfOutput . ConfigTrafficVersion
70
82
}
71
83
72
- if ( scfOutput . Traffic ) {
73
- outputs [ curRegion ] . traffic = scfOutput . Traffic
74
- this . state . functionTraffic = scfOutput . Traffic
75
- }
84
+ this . state . lastVersion = outputs [ curRegion ] . lastVersion
85
+ this . state . traffic = outputs [ curRegion ] . traffic
76
86
}
77
87
uploadCodeHandler . push ( funcDeployer ( ) )
78
88
}
You can’t perform that action at this time.
0 commit comments