mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-31 03:22:18 +00:00
System inform (#2263)
* feat: Bind Notification Pipe (#2229) * chore: account page add bind notification modal * feat: timerlock schema and type * feat(fe): bind notification method modal * chore: fe adjust * feat: clean useless code * fix: cron lock * chore: adjust the code * chore: rename api * chore: remove unused code * chore: fe adjust * perf: bind inform ux * fix: time ts * chore: notification (#2251) * perf: send message code * perf: sub schema index * fix: timezone plugin * fix: format --------- Co-authored-by: Finley Ge <32237950+FinleyGe@users.noreply.github.com>
This commit is contained in:
@@ -88,7 +88,7 @@ export async function generateQA(): Promise<any> {
|
||||
}
|
||||
|
||||
// auth balance
|
||||
if (!(await checkTeamAiPointsAndLock(data.teamId, data.tmbId))) {
|
||||
if (!(await checkTeamAiPointsAndLock(data.teamId))) {
|
||||
reduceQueue();
|
||||
return generateQA();
|
||||
}
|
||||
|
@@ -89,7 +89,7 @@ export async function generateVector(): Promise<any> {
|
||||
}
|
||||
|
||||
// auth balance
|
||||
if (!(await checkTeamAiPointsAndLock(data.teamId, data.tmbId))) {
|
||||
if (!(await checkTeamAiPointsAndLock(data.teamId))) {
|
||||
reduceQueue();
|
||||
return generateVector();
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ import { sendOneInform } from '../support/user/inform/api';
|
||||
import { lockTrainingDataByTeamId } from '@fastgpt/service/core/dataset/training/controller';
|
||||
import { InformLevelEnum } from '@fastgpt/global/support/user/inform/constants';
|
||||
|
||||
export const checkTeamAiPointsAndLock = async (teamId: string, tmbId: string) => {
|
||||
export const checkTeamAiPointsAndLock = async (teamId: string) => {
|
||||
try {
|
||||
await checkTeamAIPoints(teamId);
|
||||
return true;
|
||||
@@ -13,11 +13,10 @@ export const checkTeamAiPointsAndLock = async (teamId: string, tmbId: string) =>
|
||||
// send inform and lock data
|
||||
try {
|
||||
sendOneInform({
|
||||
level: InformLevelEnum.important,
|
||||
title: '文本训练任务中止',
|
||||
content:
|
||||
'该团队账号AI积分不足,文本训练任务中止,重新充值后将会继续。暂停的任务将在 7 天后被删除。',
|
||||
tmbId: tmbId
|
||||
level: InformLevelEnum.emergency,
|
||||
templateCode: 'LACK_OF_POINTS',
|
||||
templateParam: {},
|
||||
teamId
|
||||
});
|
||||
console.log('余额不足,暂停【向量】生成任务');
|
||||
lockTrainingDataByTeamId(teamId);
|
||||
|
Reference in New Issue
Block a user