mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-31 11:28:51 +00:00
4.8.9 test fix (#2291)
* perf: read file icon * perf:icon * fix: i18n * perf: hide pro api * perf: upload expired time * perf: upload file frequency limit * perf: upload file ux * perf: input file tip * perf: qa custom chunk size * feat: dataset openapi * fix: auth dataset list * fix: openapi doc * perf: zero temperature change to 0.01 * perf: read file prompt * perf: read file prompt * perf: free plan tip * feat: cron job usage
This commit is contained in:
8
projects/app/src/service/common/frequencyLimit/api.ts
Normal file
8
projects/app/src/service/common/frequencyLimit/api.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import { AuthFrequencyLimitProps } from '@fastgpt/global/common/frequenctLimit/type';
|
||||
import { POST } from '@fastgpt/service/common/api/plusRequest';
|
||||
|
||||
export const authFrequencyLimit = (data: AuthFrequencyLimitProps) => {
|
||||
if (!global.feConfigs.isPlus) return;
|
||||
|
||||
return POST('/common/freequencyLimit/auth', data);
|
||||
};
|
@@ -1,4 +1,5 @@
|
||||
import { getUserChatInfoAndAuthTeamPoints } from '@/service/support/permission/auth/team';
|
||||
import { pushChatUsage } from '@/service/support/wallet/usage/push';
|
||||
import { defaultApp } from '@/web/core/app/constants';
|
||||
import { getNextTimeByCronStringAndTimezone } from '@fastgpt/global/common/string/time';
|
||||
import { getNanoid } from '@fastgpt/global/common/string/tools';
|
||||
@@ -9,6 +10,7 @@ import {
|
||||
initWorkflowEdgeStatus,
|
||||
storeNodes2RuntimeNodes
|
||||
} from '@fastgpt/global/core/workflow/runtime/utils';
|
||||
import { UsageSourceEnum } from '@fastgpt/global/support/wallet/usage/constants';
|
||||
import { addLog } from '@fastgpt/service/common/system/log';
|
||||
import { MongoApp } from '@fastgpt/service/core/app/schema';
|
||||
import { dispatchWorkFlow } from '@fastgpt/service/core/workflow/dispatch';
|
||||
@@ -29,7 +31,7 @@ export const getScheduleTriggerApp = async () => {
|
||||
const { user } = await getUserChatInfoAndAuthTeamPoints(app.tmbId);
|
||||
|
||||
try {
|
||||
await dispatchWorkFlow({
|
||||
const { flowUsages } = await dispatchWorkFlow({
|
||||
chatId: getNanoid(),
|
||||
user,
|
||||
mode: 'chat',
|
||||
@@ -53,6 +55,14 @@ export const getScheduleTriggerApp = async () => {
|
||||
detail: false,
|
||||
maxRunTimes: 200
|
||||
});
|
||||
pushChatUsage({
|
||||
appName: app.name,
|
||||
appId: app._id,
|
||||
teamId: String(app.teamId),
|
||||
tmbId: String(app.tmbId),
|
||||
source: UsageSourceEnum.cronJob,
|
||||
flowUsages
|
||||
});
|
||||
} catch (error) {
|
||||
addLog.error('Schedule trigger error', error);
|
||||
}
|
||||
|
Reference in New Issue
Block a user