mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 05:12:39 +00:00
perf: load plugin groups code;perf: system plugin schema;fix: special variables replace;perf: retry cron app job (#3347)
* perf: load plugin groups code * perf: system plugin schema * feat: retry cron app job * fix: special variables replace
This commit is contained in:
@@ -4,3 +4,15 @@ export const delay = (ms: number) =>
|
||||
resolve('');
|
||||
}, ms);
|
||||
});
|
||||
|
||||
export const retryFn = async <T>(fn: () => Promise<T>, retryTimes = 3): Promise<T> => {
|
||||
try {
|
||||
return fn();
|
||||
} catch (error) {
|
||||
if (retryTimes > 0) {
|
||||
await delay(500);
|
||||
return retryFn(fn, retryTimes - 1);
|
||||
}
|
||||
return Promise.reject(error);
|
||||
}
|
||||
};
|
||||
|
3
packages/global/core/dataset/type.d.ts
vendored
3
packages/global/core/dataset/type.d.ts
vendored
@@ -34,6 +34,9 @@ export type DatasetSchemaType = {
|
||||
inheritPermission: boolean;
|
||||
apiServer?: APIFileServer;
|
||||
|
||||
syncSchedule?: { cronString: string; timezone: string };
|
||||
syncNextTime?: Date;
|
||||
|
||||
// abandon
|
||||
externalReadUrl?: string;
|
||||
defaultPermission?: number;
|
||||
|
@@ -321,7 +321,7 @@ export function replaceEditorVariable({
|
||||
})();
|
||||
|
||||
const regex = new RegExp(`\\{\\{\\$(${nodeId}\\.${id})\\$\\}\\}`, 'g');
|
||||
text = text.replace(regex, formatVal);
|
||||
text = text.replace(regex, () => formatVal);
|
||||
});
|
||||
|
||||
return text || '';
|
||||
|
Reference in New Issue
Block a user