mirror of
https://github.com/steedos/steedos-platform
synced 2024-11-22 00:01:52 +00:00
fix 40个自定义对象且同时存在db、文件时,服务启动特别慢 #2723
This commit is contained in:
parent
76a614373e
commit
3f675c7f2b
@ -24,6 +24,7 @@ const _routers: Array<any> = [];
|
||||
const _objectsData: Dictionary<any> = {};
|
||||
const delayLoadExtendObjectConfigQueue: Dictionary<any> = {};
|
||||
let standardObjectsLoaded: boolean = false;
|
||||
let dbMetadataLoaing: boolean = false;
|
||||
|
||||
const addDelayLoadExtendObjectConfig = function (extend: string, config: SteedosObjectTypeConfig){
|
||||
if(!delayLoadExtendObjectConfigQueue[extend]){
|
||||
@ -323,10 +324,17 @@ export const removeObjectListenerConfig = (_id, listenTo, when)=>{
|
||||
}
|
||||
}
|
||||
|
||||
export const loadStandardMetadata = async (serviceName: string, datasourceApiName: string) =>{
|
||||
export const loadStandardMetadata = async (serviceName: string, datasourceApiName: string) => {
|
||||
await loadStandardProfiles(serviceName);
|
||||
await loadStandardPermissionsets(serviceName);
|
||||
await loadStandardBaseObjects(serviceName);
|
||||
if (dbMetadataLoaing != true) {
|
||||
dbMetadataLoaing = true;
|
||||
await loadDbMetadatas(datasourceApiName);
|
||||
}
|
||||
}
|
||||
|
||||
export const loadDbMetadatas = async (datasourceApiName: string) => {
|
||||
if(datasourceApiName === 'default' || datasourceApiName === 'meteor'){
|
||||
const datasource = getDataSource(datasourceApiName)
|
||||
if(datasource && datasourceApiName === 'default'){
|
||||
|
Loading…
Reference in New Issue
Block a user