n8n-nodes-chat2crm 0.1.13 → 0.1.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -106,6 +106,14 @@ class Chat2CrmTrigger {
|
|
|
106
106
|
// Инициализируем lastReadIds для каждого stream и собираем информацию
|
|
107
107
|
for (const [db, dbStreams] of streamsByDb.entries()) {
|
|
108
108
|
const redis = redisConnections.get(db);
|
|
109
|
+
// ИСПРАВЛЕНИЕ: Явно выбираем базу данных перед проверкой stream'ов
|
|
110
|
+
try {
|
|
111
|
+
await redis.select(db);
|
|
112
|
+
console.log(`[Chat2Crm Trigger] Selected DB ${db} before checking streams`);
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.error(`[Chat2Crm Trigger] Failed to select DB ${db}:`, error.message);
|
|
116
|
+
}
|
|
109
117
|
for (const stream of dbStreams) {
|
|
110
118
|
try {
|
|
111
119
|
// Пытаемся получить информацию о stream
|
|
@@ -188,14 +188,10 @@ async function createRedisConnection(credentials, db = 0) {
|
|
|
188
188
|
});
|
|
189
189
|
redis.on('ready', async () => {
|
|
190
190
|
console.log(`[Redis Connection] Redis ready at ${redisHost}:${redisPort}, DB ${selectedDb}`);
|
|
191
|
-
//
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
}
|
|
196
|
-
catch (error) {
|
|
197
|
-
console.error(`[Redis Connection] Failed to select DB ${selectedDb}:`, error.message);
|
|
198
|
-
}
|
|
191
|
+
// УБИРАЕМ select - он не нужен, так как db уже указан в конфигурации
|
|
192
|
+
// И вызов select после ready может вызвать проблемы, если проверка stream'ов уже началась
|
|
193
|
+
// await redis.select(selectedDb);
|
|
194
|
+
// console.log(`[Redis Connection] Explicitly selected DB ${selectedDb}`);
|
|
199
195
|
});
|
|
200
196
|
redis.on('error', (err) => {
|
|
201
197
|
console.error(`[Redis Connection] Redis error on ${redisHost}:${redisPort}, DB ${selectedDb}:`, err.message);
|