fix circular dependency of updateStorageUsage and checkStorage in utils
This commit is contained in:
parent
4038eb13fc
commit
cfb68e48a9
|
|
@ -28,6 +28,9 @@
|
|||
"start:default": "cd bin && ./run start",
|
||||
"start-worker:windows": "cd bin && run worker",
|
||||
"start-worker:default": "cd bin && ./run worker",
|
||||
"user": "run-script-os",
|
||||
"user:windows": "cd bin && run user",
|
||||
"user:default": "cd bin && ./run user",
|
||||
"dev": "nodemon",
|
||||
"oclif-dev": "run-script-os",
|
||||
"oclif-dev:windows": "cd bin && dev start",
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {
|
|||
getStartingNodes,
|
||||
resolveVariables
|
||||
} from '../../utils'
|
||||
import { checkStorage, updateStorageUsage } from '../../utils/quotaUsage'
|
||||
import { getRunningExpressApp } from '../../utils/getRunningExpressApp'
|
||||
import { ChatFlow } from '../../database/entities/ChatFlow'
|
||||
import { IDepthQueue, IReactFlowNode } from '../../Interface'
|
||||
|
|
@ -110,7 +111,9 @@ const buildAndInitTool = async (chatflowid: string, _chatId?: string, _apiMessag
|
|||
variableOverrides,
|
||||
orgId,
|
||||
workspaceId,
|
||||
subscriptionId
|
||||
subscriptionId,
|
||||
updateStorageUsage,
|
||||
checkStorage
|
||||
})
|
||||
|
||||
const nodeToExecute =
|
||||
|
|
|
|||
|
|
@ -515,7 +515,9 @@ export const executeFlow = async ({
|
|||
baseURL,
|
||||
orgId,
|
||||
workspaceId,
|
||||
subscriptionId
|
||||
subscriptionId,
|
||||
updateStorageUsage,
|
||||
checkStorage
|
||||
})
|
||||
|
||||
const setVariableNodesOutput = getSetVariableNodesOutput(reactFlowNodes)
|
||||
|
|
|
|||
|
|
@ -64,8 +64,6 @@ import {
|
|||
SecretsManagerClient,
|
||||
SecretsManagerClientConfig
|
||||
} from '@aws-sdk/client-secrets-manager'
|
||||
import { checkStorage, updateStorageUsage } from './quotaUsage'
|
||||
import { UsageCacheManager } from '../UsageCacheManager'
|
||||
|
||||
export const QUESTION_VAR_PREFIX = 'question'
|
||||
export const FILE_ATTACHMENT_PREFIX = 'file_attachment'
|
||||
|
|
@ -504,8 +502,10 @@ type BuildFlowParams = {
|
|||
orgId?: string
|
||||
workspaceId?: string
|
||||
subscriptionId?: string
|
||||
usageCacheManager?: UsageCacheManager
|
||||
usageCacheManager?: any
|
||||
uploadedFilesContent?: string
|
||||
updateStorageUsage?: (orgId: string, workspaceId: string, totalSize: number, usageCacheManager?: any) => void
|
||||
checkStorage?: (orgId: string, subscriptionId: string, usageCacheManager: any) => Promise<any>
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -540,7 +540,9 @@ export const buildFlow = async ({
|
|||
orgId,
|
||||
workspaceId,
|
||||
subscriptionId,
|
||||
usageCacheManager
|
||||
usageCacheManager,
|
||||
updateStorageUsage,
|
||||
checkStorage
|
||||
}: BuildFlowParams) => {
|
||||
const flowNodes = cloneDeep(reactFlowNodes)
|
||||
|
||||
|
|
|
|||
|
|
@ -193,7 +193,9 @@ export const executeUpsert = async ({
|
|||
variableOverrides,
|
||||
orgId,
|
||||
workspaceId,
|
||||
subscriptionId
|
||||
subscriptionId,
|
||||
updateStorageUsage,
|
||||
checkStorage
|
||||
})
|
||||
|
||||
// Save to DB
|
||||
|
|
|
|||
Loading…
Reference in New Issue