Commit 7942805a by Archer Committed by GitHub

fix: usage repeat (#5735)

* fix: usage repeat

* remove invalid code
parent b8c2c7ad
......@@ -386,6 +386,7 @@ export const runToolCall = async (
initToolNodes(runtimeNodes, [toolNode.nodeId], startParams);
const toolRunResponse = await runWorkflow({
...workflowProps,
usageId: undefined,
isToolCall: true
});
......
......@@ -8,7 +8,8 @@ import {
} from '@fastgpt/global/support/user/team/constant';
import { UsageCollectionName, UsageItemCollectionName } from './constants';
const UsageSchema = new Schema({
const UsageSchema = new Schema(
{
teamId: {
type: Schema.Types.ObjectId,
ref: TeamCollectionName,
......@@ -53,7 +54,14 @@ const UsageSchema = new Schema({
list: {
type: Array
}
});
},
{
// Auto update time
timestamps: {
updatedAt: 'time'
}
}
);
UsageSchema.virtual('usageItems', {
ref: UsageItemCollectionName,
......
import type { ConcatUsageProps } from '@fastgpt/global/support/wallet/usage/api';
declare global {
var reduceAiPointsQueue: { teamId: string; totalPoints: number }[];
var concatBillQueue: ConcatUsageProps[];
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment