Skip to content

Commit dddb9f6

Browse files
committed
fix: metrics qps limit
1 parent 32e519c commit dddb9f6

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"download": "^8.0.0",
1616
"fs-extra": "^8.1.0",
1717
"moment": "^2.24.0",
18-
"tencent-cloud-sdk": "^0.1.2",
18+
"tencent-cloud-sdk": "^0.1.3",
1919
"tencent-component-toolkit": "^1.4.3",
2020
"type": "^2.0.0"
2121
}

src/serverless.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { Component } = require('@serverless/core')
2-
const { MultiApigw, Scf, Apigw, Cos, Cns } = require('tencent-component-toolkit')
2+
const { MultiApigw, Scf, Apigw, Cos, Cns, Cam } = require('tencent-component-toolkit')
33
const moment = require('moment')
44
const util = require('util')
55
const { slsMonitor } = require('tencent-cloud-sdk')
@@ -79,6 +79,13 @@ class ServerlessComponent extends Component {
7979
packageDir = await packageCode(this, inputs)
8080
}
8181

82+
const camClient = new Cam(credentials)
83+
if (!inputs.role) {
84+
if (camClient.CheckSCFExcuteRole()) {
85+
inputs.role = 'QCS_SCFExcuteRole'
86+
}
87+
}
88+
8289
// 上传代码到COS
8390
const uploadCodeHandler = []
8491
const outputs = {}

0 commit comments

Comments
 (0)