Browse Source

频率限制

release_1.3.0
巴林闲侠 3 years ago
parent
commit
e37d0ac53b
  1. 5
      code/VideoAccess-VCMP/script/1.3.1/data/1_sync_camera_data/index.js

5
code/VideoAccess-VCMP/script/1.3.1/data/1_sync_camera_data/index.js

@ -72,6 +72,7 @@ try {
let beloneSecretId = null let beloneSecretId = null
let serialUnlegal = false let serialUnlegal = false
for (let s of secretRes) { for (let s of secretRes) {
let start = (new Date()).getTime();
console.log(`当前查询账号key ${s.key}`); console.log(`当前查询账号key ${s.key}`);
if (!s.newToken) { if (!s.newToken) {
const tokenRes = await request.post(`${yingshiHost}lapp/token/get`).query({ const tokenRes = await request.post(`${yingshiHost}lapp/token/get`).query({
@ -89,6 +90,10 @@ try {
} }
} }
while (((new Date()).getTime() - start) < 3000) {//限制频率
continue;
}
// 检测设备所属 // 检测设备所属
const cameraState = await request.post(`${yingshiHost}lapp/device/info`).query({ const cameraState = await request.post(`${yingshiHost}lapp/device/info`).query({
accessToken: s.newToken, accessToken: s.newToken,

Loading…
Cancel
Save