Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@botpress/studio",
"version": "0.0.20",
"version": "0.0.21",
"description": "Create your virtual assistants",
"main": "index.js",
"bin": "./packages/studio-be/out/index.js",
Expand Down
9 changes: 6 additions & 3 deletions packages/studio-be/src/core/distributed/async-redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,21 @@ export const getOrCreate = (type: 'subscriber' | 'commands' | 'socket', url?: st
return Math.min(times * 200, 5000)
}

const { REDIS_URL, REDIS_OPTIONS, BP_REDIS_SCOPE, SERVER_ID } = process.env

let redisNodes: ClusterNode[] = []
try {
redisNodes = process.env.REDIS_URL ? JSON.parse(process.env.REDIS_URL) : []
redisNodes = REDIS_URL ? JSON.parse(REDIS_URL) : []
} catch {}

let options = {}
try {
options = process.env.REDIS_OPTIONS ? JSON.parse(process.env.REDIS_OPTIONS) : {}
options = REDIS_OPTIONS ? JSON.parse(REDIS_OPTIONS) : {}
} catch {}

const redisOptions: RedisOptions = {
retryStrategy: RETRY_STRATEGY
retryStrategy: RETRY_STRATEGY,
connectionName: `${BP_REDIS_SCOPE ? `${BP_REDIS_SCOPE}/` : ''}studio/${SERVER_ID}`
}

if (redisNodes.length > 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ class BottomPanel extends React.Component<Props, State> {
}

setupListener = () => {
// @ts-ignore
EventBus.default.on(`logs::${window.BOT_ID}`, ({ id, level, message, args }) => {
const isGlobalOrCurrentBotLog = (scope: string) => [`logs::${window.BOT_ID}`, 'logs::*'].includes(scope)

EventBus.default.onAny((name, { level, message, args }) => {
if (!name || typeof name !== 'string' || !isGlobalOrCurrentBotLog(name)) {
return
}

this.logs.push({
ts: new Date(),
id: nanoid(10),
Expand Down