chore: 接口轮训添加限制, 接口正常返回才轮训 Close: #7260 (#7263)

This commit is contained in:
liaoxuezhi 2023-06-28 18:41:38 +08:00 committed by GitHub
parent 80974c2c12
commit 71c0d6eda9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 10 additions and 7 deletions

View File

@ -94,7 +94,6 @@
"jest": {
"verbose": true,
"testEnvironment": "jsdom",
"collectCoverage": true,
"coverageReporters": [
"text",
"cobertura"

View File

@ -661,7 +661,7 @@ export default class Form extends React.Component<FormProps, object> {
const {data, store, dispatchEvent} = this.props;
if (store.fetching) {
return;
return value;
}
// 派发init事件参数为初始化数据
@ -810,7 +810,8 @@ export default class Form extends React.Component<FormProps, object> {
const {interval, silentPolling, stopAutoRefreshWhen, data} = this.props;
clearTimeout(this.timer);
interval &&
value?.ok &&
interval &&
this.mounted &&
(!stopAutoRefreshWhen || !evalExpression(stopAutoRefreshWhen, data)) &&
(this.timer = setTimeout(

View File

@ -1245,7 +1245,8 @@ export default class CRUD extends React.Component<CRUDProps, any> {
);
}
interval &&
value?.ok && // 接口正常返回才继续轮训
interval &&
this.mounted &&
(!stopAutoRefreshWhen ||
!(

View File

@ -579,7 +579,8 @@ export default class CRUD2 extends React.Component<CRUD2Props, any> {
isTable2: true
})
.then(value => {
interval &&
value?.ok && // 接口正常返回才继续轮训
interval &&
!this.stopingAutoRefresh &&
this.mounted &&
(!stopAutoRefreshWhen ||

View File

@ -701,7 +701,8 @@ export default class Page extends React.Component<PageProps> {
})
);
interval &&
value?.ok && // 接口正常返回才继续轮训
interval &&
this.mounted &&
(!stopAutoRefreshWhen || !evalExpression(stopAutoRefreshWhen, data)) &&
(this.timer = setTimeout(

View File

@ -531,7 +531,7 @@ export default class Service extends React.Component<ServiceProps> {
onBulkChange(data);
}
this.initInterval(data);
result?.ok && this.initInterval(data);
}
afterSchemaFetch(schema: any) {