n8n-nodes-chat2crm 0.1.10 → 0.1.12
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.
|
@@ -87,8 +87,12 @@ class Chat2CrmTrigger {
|
|
|
87
87
|
throw new n8n_workflow_1.ApplicationError(`Count must be between ${MIN_COUNT} and ${MAX_COUNT}`, { level: 'error' });
|
|
88
88
|
}
|
|
89
89
|
const pollInterval = Math.min(pollIntervalSeconds * 1000, MAX_BLOCK_TIME_FOR_RESPONSIVENESS_MS);
|
|
90
|
-
//
|
|
91
|
-
|
|
90
|
+
// ИСПРАВЛЕНИЕ: Используем базу данных из credentials, а не из конфигурации stream'ов
|
|
91
|
+
// Пользователь явно выбрал базу данных в настройках подключения
|
|
92
|
+
const credentialsDb = credentials.db ?? 0;
|
|
93
|
+
// Группируем все выбранные streams в одну базу данных из credentials
|
|
94
|
+
const streamsByDb = new Map();
|
|
95
|
+
streamsByDb.set(credentialsDb, selectedStreams);
|
|
92
96
|
// Создаем подключения к Redis только для нужных баз данных
|
|
93
97
|
const redisConnections = new Map();
|
|
94
98
|
for (const db of streamsByDb.keys()) {
|
|
@@ -71,14 +71,14 @@ exports.STREAM_DEFINITIONS = [
|
|
|
71
71
|
{
|
|
72
72
|
name: 'N8N Incoming Message',
|
|
73
73
|
value: 'n8n_incoming_message',
|
|
74
|
-
description: 'Incoming messages to N8N (DB
|
|
75
|
-
db:
|
|
74
|
+
description: 'Incoming messages to N8N (DB 1)',
|
|
75
|
+
db: 1,
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
name: 'N8N Outgoing Message',
|
|
79
79
|
value: 'n8n_outgoing_message',
|
|
80
|
-
description: 'Outgoing messages from N8N (DB
|
|
81
|
-
db:
|
|
80
|
+
description: 'Outgoing messages from N8N (DB 1)',
|
|
81
|
+
db: 1,
|
|
82
82
|
},
|
|
83
83
|
];
|
|
84
84
|
/**
|
|
@@ -90,6 +90,8 @@ exports.STREAM_DB_MAP = {
|
|
|
90
90
|
crm_lazy_incoming_message: 1,
|
|
91
91
|
crm_contacts: 1,
|
|
92
92
|
crm_outgoing_status: 1,
|
|
93
|
+
n8n_incoming_message: 1,
|
|
94
|
+
n8n_outgoing_message: 1,
|
|
93
95
|
};
|
|
94
96
|
/**
|
|
95
97
|
* Определяет номер базы данных для указанного stream
|