mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-28 19:00:59 +03:00
Feature - Env variable to disable ChatFlow reuse (#2559)
This commit is contained in:
@@ -22,6 +22,8 @@ PORT=3000
|
||||
# FLOWISE_SECRETKEY_OVERWRITE=myencryptionkey
|
||||
# FLOWISE_FILE_SIZE_LIMIT=50mb
|
||||
|
||||
# DISABLE_CHATFLOW_REUSE=true
|
||||
|
||||
# DEBUG=true
|
||||
# LOG_PATH=/your_log_path/.flowise/logs
|
||||
# LOG_LEVEL=debug (error | warn | info | verbose | debug)
|
||||
|
||||
@@ -32,6 +32,7 @@ export default class Start extends Command {
|
||||
TOOL_FUNCTION_BUILTIN_DEP: Flags.string(),
|
||||
TOOL_FUNCTION_EXTERNAL_DEP: Flags.string(),
|
||||
NUMBER_OF_PROXIES: Flags.string(),
|
||||
DISABLE_CHATFLOW_REUSE: Flags.string(),
|
||||
DATABASE_TYPE: Flags.string(),
|
||||
DATABASE_PATH: Flags.string(),
|
||||
DATABASE_PORT: Flags.string(),
|
||||
@@ -93,6 +94,7 @@ export default class Start extends Command {
|
||||
if (flags.IFRAME_ORIGINS) process.env.IFRAME_ORIGINS = flags.IFRAME_ORIGINS
|
||||
if (flags.DEBUG) process.env.DEBUG = flags.DEBUG
|
||||
if (flags.NUMBER_OF_PROXIES) process.env.NUMBER_OF_PROXIES = flags.NUMBER_OF_PROXIES
|
||||
if (flags.DISABLE_CHATFLOW_REUSE) process.env.DISABLE_CHATFLOW_REUSE = flags.DISABLE_CHATFLOW_REUSE
|
||||
|
||||
// Authorization
|
||||
if (flags.FLOWISE_USERNAME) process.env.FLOWISE_USERNAME = flags.FLOWISE_USERNAME
|
||||
|
||||
@@ -187,6 +187,7 @@ export const utilBuildChatflow = async (req: Request, socketIO?: Server, isInter
|
||||
const prependMessages = incomingInput.history
|
||||
|
||||
/* Reuse the flow without having to rebuild (to avoid duplicated upsert, recomputation, reinitialization of memory) when all these conditions met:
|
||||
* - Reuse of flows is not disabled
|
||||
* - Node Data already exists in pool
|
||||
* - Still in sync (i.e the flow has not been modified since)
|
||||
* - Existing overrideConfig and new overrideConfig are the same
|
||||
@@ -194,6 +195,7 @@ export const utilBuildChatflow = async (req: Request, socketIO?: Server, isInter
|
||||
***/
|
||||
const isFlowReusable = () => {
|
||||
return (
|
||||
process.env.DISABLE_CHATFLOW_REUSE !== 'true' &&
|
||||
Object.prototype.hasOwnProperty.call(appServer.chatflowPool.activeChatflows, chatflowid) &&
|
||||
appServer.chatflowPool.activeChatflows[chatflowid].inSync &&
|
||||
appServer.chatflowPool.activeChatflows[chatflowid].endingNodeData &&
|
||||
|
||||
Reference in New Issue
Block a user