iobroker.influxdb 2.6.0 → 2.6.3
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.
- package/README.md +11 -0
- package/io-package.json +37 -37
- package/lib/Database.js +2 -2
- package/lib/DatabaseInfluxDB1x.js +11 -6
- package/lib/DatabaseInfluxDB2x.js +2 -2
- package/main.js +5 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -353,6 +353,17 @@ sendTo('influxdb.0', 'getEnabledDPs', {}, function (result) {
|
|
|
353
353
|
-->
|
|
354
354
|
|
|
355
355
|
## Changelog
|
|
356
|
+
### 2.6.3 (2022-03-07)
|
|
357
|
+
* (Apollon77) Fix potential crash cases (Sentry IOBROKER-INFLUXDB-4Q)
|
|
358
|
+
|
|
359
|
+
### 2.6.2 (2022-03-03)
|
|
360
|
+
* (Apollon77) Correctly handle db names with hyphens for InfluxDB 1
|
|
361
|
+
* (Apollon77) Fix getHistory for non boolean fields
|
|
362
|
+
* (Apollon77) Adjust shard group duration to influxdb proposals
|
|
363
|
+
|
|
364
|
+
### 2.6.1 (2022-02-28)
|
|
365
|
+
* (Excodibur) Address issue with updating retention policy for influxDB 1
|
|
366
|
+
|
|
356
367
|
### 2.6.0 (2022-02-24)
|
|
357
368
|
* (Excodibur) Make request timeout configurable - defaults to 30s
|
|
358
369
|
* (Apollon77) Add option to also accept self signed ssl certificates for InfluxDB 2.x
|
package/io-package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"pl": "Logowanie stanów do InfluxDB",
|
|
14
14
|
"zh-cn": "将状态记录到InfluxDB中"
|
|
15
15
|
},
|
|
16
|
-
"version": "2.6.
|
|
16
|
+
"version": "2.6.3",
|
|
17
17
|
"title": "Logging data with InfluxDB",
|
|
18
18
|
"titleLang": {
|
|
19
19
|
"en": "Logging data with InfluxDB",
|
|
@@ -28,6 +28,42 @@
|
|
|
28
28
|
"zh-cn": "使用InfluxDB记录数据"
|
|
29
29
|
},
|
|
30
30
|
"news": {
|
|
31
|
+
"2.6.3": {
|
|
32
|
+
"en": "Fix potential crash cases (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
33
|
+
"de": "Mögliche Absturzfälle beheben (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
34
|
+
"ru": "Исправление возможных случаев сбоя (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
35
|
+
"pt": "Corrigir possíveis casos de travamento (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
36
|
+
"nl": "Mogelijke crashgevallen oplossen (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
37
|
+
"fr": "Correction des cas de plantage potentiels (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
38
|
+
"it": "Risolvi potenziali casi di crash (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
39
|
+
"es": "Solucionar posibles casos de bloqueo (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
40
|
+
"pl": "Napraw potencjalne przypadki awarii (Sentry IOBROKER-INFLUXDB-4Q)",
|
|
41
|
+
"zh-cn": "修复潜在的崩溃案例 (Sentry IOBROKER-INFLUXDB-4Q)"
|
|
42
|
+
},
|
|
43
|
+
"2.6.2": {
|
|
44
|
+
"en": "Correctly handle db names with hyphens for InfluxDB 1\nFix getHistory for non boolean fields\nAdjust shard group duration to influxdb proposals",
|
|
45
|
+
"de": "Behandeln Sie DB-Namen mit Bindestrichen für InfluxDB 1 korrekt\nGetHistory für nicht boolesche Felder korrigiert\nPassen Sie die Dauer der Shard-Gruppe an die Vorschläge von influxdb an",
|
|
46
|
+
"ru": "Правильно обрабатывать имена баз данных с дефисами для InfluxDB 1\nИсправление getHistory для нелогических полей\nОтрегулируйте продолжительность группы сегментов для предложений influxdb",
|
|
47
|
+
"pt": "Manipule corretamente nomes de banco de dados com hífens para InfluxDB 1\nCorrige getHistory para campos não booleanos\nAjustar a duração do grupo de fragmentos para propostas influxdb",
|
|
48
|
+
"nl": "Correct omgaan met db-namen met koppeltekens voor InfluxDB 1\nGetHistory repareren voor niet-booleaanse velden\nPas de duur van de shardgroep aan voor influxdb-voorstellen",
|
|
49
|
+
"fr": "Gérer correctement les noms de base de données avec des traits d'union pour InfluxDB 1\nCorrection de getHistory pour les champs non booléens\nAjuster la durée du groupe de fragments aux propositions influxdb",
|
|
50
|
+
"it": "Gestire correttamente i nomi db con trattini per InfluxDB 1\nRisolto il problema con getHistory per i campi non booleani\nRegola la durata del gruppo di shard alle proposte influxdb",
|
|
51
|
+
"es": "Manejar correctamente los nombres de bases de datos con guiones para InfluxDB 1\nArreglar getHistory para campos no booleanos\nAjuste la duración del grupo de fragmentos a las propuestas de influxdb",
|
|
52
|
+
"pl": "Prawidłowo obsługuj nazwy baz danych z myślnikami dla InfluxDB 1\nNapraw getHistory dla pól innych niż logiczne\nDostosuj czas trwania grupy shard do propozycji influxdb",
|
|
53
|
+
"zh-cn": "正确处理带有连字符的数据库名称,用于 InfluxDB 1\n修复非布尔字段的 getHistory\n调整分片组持续时间以适应 influxdb 提案"
|
|
54
|
+
},
|
|
55
|
+
"2.6.1": {
|
|
56
|
+
"en": "Address issue with updating retention policy for influxDB 1",
|
|
57
|
+
"de": "Beheben Sie ein Problem mit der Aktualisierung der Aufbewahrungsrichtlinie für influxDB 1",
|
|
58
|
+
"ru": "Устранить проблему с обновлением политики хранения для influxDB 1.",
|
|
59
|
+
"pt": "Resolva o problema com a atualização da política de retenção para o influxDB 1",
|
|
60
|
+
"nl": "Probleem oplossen met het bijwerken van het bewaarbeleid voor influxDB 1",
|
|
61
|
+
"fr": "Résoudre le problème de mise à jour de la stratégie de rétention pour influxDB 1",
|
|
62
|
+
"it": "Risoluzione del problema con l'aggiornamento del criterio di conservazione per influxDB 1",
|
|
63
|
+
"es": "Solucionar el problema con la actualización de la política de retención para influxDB 1",
|
|
64
|
+
"pl": "Rozwiąż problem z aktualizacją zasad przechowywania dla influxDB 1",
|
|
65
|
+
"zh-cn": "解决更新 influxDB 1 保留策略的问题"
|
|
66
|
+
},
|
|
31
67
|
"2.6.0": {
|
|
32
68
|
"en": "Make request timeout configurable - defaults to 30s\nAdd option to also accept self signed ssl certificates for InfluxDB 2.x",
|
|
33
69
|
"de": "Anforderungs-Timeout konfigurierbar machen – standardmäßig 30 Sekunden\nOption hinzugefügt, um auch selbstsignierte SSL-Zertifikate für InfluxDB 2.x zu akzeptieren",
|
|
@@ -75,42 +111,6 @@
|
|
|
75
111
|
"es": "Se agregaron nuevos mensajes: 'actualizar', 'eliminar', 'eliminar rango', 'eliminar todo' (solo para influxdb v1)\nAgregación corregida de datos",
|
|
76
112
|
"pl": "Dodano nowe wiadomości: 'update', 'delete', 'deleteRange', 'deleteAll' (tylko dla influxdb v1)\nPoprawiona agregacja danych",
|
|
77
113
|
"zh-cn": "添加了新消息:'update'、'delete'、'deleteRange'、'deleteAll'(仅适用于 influxdb v1)\n更正的数据聚合"
|
|
78
|
-
},
|
|
79
|
-
"2.4.0": {
|
|
80
|
-
"en": "Added expert settings to deactivate health checks for Influx 2 db (There are no health checks for Influx 1)\nHide settings not relevant when \"log changes only\" is not used\nAllow all number values for debounce again\nInfluxDB also do not like Infinite values, so ignore them too",
|
|
81
|
-
"de": "Experteneinstellungen hinzugefügt, um Gesundheitsprüfungen für Influx 2 db zu deaktivieren (Es gibt keine Gesundheitsprüfungen für Influx 1)\nNicht relevante Einstellungen ausblenden, wenn \"Nur Änderungen protokollieren\" nicht verwendet wird\nAlle Zahlenwerte wieder für die Entprellung zulassen\nInfluxDB mag auch keine unendlichen Werte, also ignoriere sie auch",
|
|
82
|
-
"ru": "Добавлены экспертные настройки для отключения проверок работоспособности для Influx 2 db (для Influx 1 проверки работоспособности отсутствуют)\nСкрыть настройки, не актуальные, если не используется \"только журнал изменений\"\nРазрешить все числовые значения для устранения дребезга снова\nInfluxDB также не любит бесконечные значения, поэтому игнорируйте их тоже",
|
|
83
|
-
"pt": "Adicionadas configurações de especialistas para desativar verificações de saúde para o Influx 2 db (não há verificações de saúde para o Influx 1)\nOcultar configurações irrelevantes quando \"apenas registro de alterações\" não é usado\nPermitir todos os valores numéricos para debounce novamente\nInfluxDB também não gosta de valores infinitos, então ignore-os também",
|
|
84
|
-
"nl": "Expertinstellingen toegevoegd om statuscontroles voor Influx 2 db te deactiveren (Er zijn geen statuscontroles voor Influx 1)\nInstellingen verbergen die niet relevant zijn wanneer \"alleen logboekwijzigingen\" niet wordt gebruikt\nSta alle getalwaarden opnieuw toe voor debounce\nInfluxDB houdt ook niet van oneindige waarden, dus negeer ze ook",
|
|
85
|
-
"fr": "Ajout de paramètres experts pour désactiver les contrôles de santé pour Influx 2 db (il n'y a pas de contrôles de santé pour Influx 1)\nMasquer les paramètres non pertinents lorsque \"log changes only\" n'est pas utilisé\nAutoriser à nouveau toutes les valeurs numériques pour l'anti-rebond\nInfluxDB n'aime pas non plus les valeurs infinies, alors ignorez-les aussi",
|
|
86
|
-
"it": "Aggiunte impostazioni avanzate per disattivare i controlli di integrità per Influx 2 db (non ci sono controlli di integrità per Influx 1)\nNascondi le impostazioni non rilevanti quando non viene utilizzato \"solo modifiche al registro\"\nConsenti di nuovo l'antirimbalzo di tutti i valori numerici\nAnche a InfluxDB non piacciono i valori Infinite, quindi ignorali anche tu",
|
|
87
|
-
"es": "Se agregaron configuraciones de experto para desactivar los controles de salud para Influx 2 db (no hay controles de salud para Influx 1)\nOcultar la configuración que no es relevante cuando no se utiliza \"solo cambios de registro\"\nPermitir todos los valores numéricos para antirrebote nuevamente\nInfluxDB tampoco le gustan los valores infinitos, así que ignórelos también",
|
|
88
|
-
"pl": "Dodano ustawienia eksperckie, aby dezaktywować kontrole kondycji dla Influx 2 db (Brak kontroli kondycji dla Influx 1)\nUkryj ustawienia nieistotne, gdy nie używasz opcji „tylko rejestruj zmiany”\nZezwól ponownie na odrzucenie wszystkich wartości liczbowych\nInfluxDB również nie lubi wartości Infinite, więc je również zignoruj",
|
|
89
|
-
"zh-cn": "添加了专家设置以停用 Influx 2 db 的健康检查(Influx 1 没有健康检查)\n不使用“仅记录更改”时隐藏不相关的设置\n再次允许所有数值去抖动\nInfluxDB 也不喜欢 Infinite 值,所以也忽略它们"
|
|
90
|
-
},
|
|
91
|
-
"2.3.0": {
|
|
92
|
-
"en": "Support only `js.controller` >= 3.3.x\nUsed system/custom view for collecting the objects\nImplemented option to ignore zero- or/and below zero- values",
|
|
93
|
-
"de": "Unterstützt nur `js.controller` >= 3.3.x\nVerwendete Systemansicht/benutzerdefinierte Ansicht zum Sammeln der Objekte\nImplementierte Option zum Ignorieren von Null- oder/und Unter-Null-Werten",
|
|
94
|
-
"ru": "Поддерживает только `js.controller`> = 3.3.x\nИспользуемый системный / пользовательский вид для сбора объектов\nРеализована возможность игнорировать нулевые и / или отрицательные значения.",
|
|
95
|
-
"pt": "Suporte apenas `js.controller`> = 3.3.x\nSistema usado / visão personalizada para coletar os objetos\nOpção implementada para ignorar valores zero ou / e abaixo de zero",
|
|
96
|
-
"nl": "Ondersteuning alleen `js.controller` >= 3.3.x\nGebruikt systeem/aangepaste weergave voor het verzamelen van de objecten\nGeïmplementeerde optie om nul- of/en onder nul-waarden te negeren",
|
|
97
|
-
"fr": "Supporte uniquement `js.controller` >= 3.3.x\nSystème utilisé/vue personnalisée pour la collecte des objets\nOption implémentée pour ignorer les valeurs zéro ou/et inférieures à zéro",
|
|
98
|
-
"it": "Supporta solo `js.controller` >= 3.3.x\nSistema utilizzato/vista personalizzata per la raccolta degli oggetti\nOpzione implementata per ignorare i valori zero o/o inferiori a zero",
|
|
99
|
-
"es": "Admite solo `js.controller`> = 3.3.x\nSistema usado / vista personalizada para recolectar los objetos.\nOpción implementada para ignorar valores cero o inferiores a cero",
|
|
100
|
-
"pl": "Obsługuje tylko `js.controller` >= 3.3.x\nUżywany system/widok niestandardowy do zbierania obiektów\nZaimplementowana opcja ignorowania wartości zerowych lub/i poniżej zera",
|
|
101
|
-
"zh-cn": "仅支持 `js.controller` >= 3.3.x\n用于收集对象的系统/自定义视图\n已实现忽略零或/和低于零值的选项"
|
|
102
|
-
},
|
|
103
|
-
"2.2.0": {
|
|
104
|
-
"en": "Added option to store metadata (q, ack, from) as tags instead of fields for Influx 2.x - see README!\nFailure to update/set retention policy will now cause warning instead of error/restart, to support more restrictive DB setups\n(Excodibur/Apollon77) Bug fixes and adjustments",
|
|
105
|
-
"de": "Option zum Speichern von Metadaten (q, ack, from) als Tags anstelle von Feldern für Influx 2.x hinzugefügt - siehe README!\nWenn die Aufbewahrungsrichtlinie nicht aktualisiert/festgelegt wird, führt dies jetzt zu einer Warnung anstelle eines Fehlers/Neustarts, um restriktivere DB-Setups zu unterstützen\n(Excodibur/Apollon77) Fehlerbehebungen und Anpassungen",
|
|
106
|
-
"ru": "Добавлена возможность хранить метаданные (q, ack, from) в виде тегов вместо полей для Influx 2.x - см. README!\nНевозможность обновить / установить политику хранения теперь будет вызывать предупреждение вместо ошибки / перезапуска для поддержки более строгих настроек БД.\n(Excodibur / Apollon77) Исправления и корректировки.",
|
|
107
|
-
"pt": "Adicionada opção para armazenar metadados (q, ack, from) como tags em vez de campos para o Influx 2.x - veja README!\nA falha em atualizar / definir a política de retenção agora causará um aviso em vez de erro / reinicialização, para oferecer suporte a configurações de banco de dados mais restritivas\n(Excodibur / Apollon77) Correções e ajustes de bugs",
|
|
108
|
-
"nl": "Optie toegevoegd om metadata (q, ack, from) op te slaan als tags in plaats van velden voor Influx 2.x - zie README!\nAls het bewaarbeleid niet wordt bijgewerkt/ingesteld, wordt er nu een waarschuwing gegeven in plaats van een fout/herstart, om restrictievere DB-instellingen te ondersteunen\n(Excodibur/Apollon77) Bugfixes en aanpassingen",
|
|
109
|
-
"fr": "Ajout d'une option pour stocker les métadonnées (q, ack, from) sous forme de balises au lieu de champs pour Influx 2.x - voir README !\nL'échec de la mise à jour/définition de la politique de rétention entraînera désormais un avertissement au lieu d'une erreur/redémarrage, pour prendre en charge des configurations de base de données plus restrictives\n(Excodibur/Apollon77) Corrections de bugs et ajustements",
|
|
110
|
-
"it": "Aggiunta l'opzione per memorizzare i metadati (q, ack, from) come tag invece dei campi per Influx 2.x - vedi README!\nIl mancato aggiornamento/impostazione della politica di conservazione ora causerà un avviso anziché un errore/riavvio, per supportare configurazioni DB più restrittive\n(Excodibur/Apollon77) Correzioni di bug e aggiustamenti",
|
|
111
|
-
"es": "Opción agregada para almacenar metadatos (q, ack, from) como etiquetas en lugar de campos para Influx 2.x - ¡vea README!\nSi no se actualiza / establece la política de retención, ahora se generará una advertencia en lugar de un error / reinicio, para admitir configuraciones de base de datos más restrictivas\n(Excodibur / Apollon77) Corrección de errores y ajustes",
|
|
112
|
-
"pl": "Dodano opcję przechowywania metadanych (q, ack, from) jako tagów zamiast pól dla Influx 2.x - zobacz README!\nNiepowodzenie aktualizacji/ustawienia zasad przechowywania spowoduje teraz ostrzeżenie zamiast błędu/ponownego uruchomienia, aby obsługiwać bardziej restrykcyjne konfiguracje bazy danych\n(Excodibur/Apollon77) Poprawki i poprawki",
|
|
113
|
-
"zh-cn": "添加了将元数据(q、ack、from)存储为标签而不是 Influx 2.x 的字段的选项 - 请参阅自述文件!\n更新/设置保留策略失败现在将导致警告而不是错误/重启,以支持更严格的数据库设置\n(Excodibur/Apollon77) 错误修复和调整"
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
"mode": "daemon",
|
package/lib/Database.js
CHANGED
|
@@ -15,11 +15,11 @@ class Database {
|
|
|
15
15
|
|
|
16
16
|
calculateShardGroupDuration(retentionTime) { // in seconds
|
|
17
17
|
// Shard Group Duration according to official Influx recommendations
|
|
18
|
-
if (!retentionTime) {//infinite
|
|
18
|
+
if (!retentionTime) { // infinite
|
|
19
19
|
return 604800; // 7 days
|
|
20
20
|
} else if (retentionTime < 172800) {// < 2 days
|
|
21
21
|
return 3600; // 1 hour
|
|
22
|
-
} else if (retentionTime >= 172800 && retentionTime <=
|
|
22
|
+
} else if (retentionTime >= 172800 && retentionTime <= 15811200) {// >= 2 days, <= 6 months (~182 days)
|
|
23
23
|
return 86400; // 1 day
|
|
24
24
|
} else {// > 6 months
|
|
25
25
|
return 604800; // 7 days
|
|
@@ -46,7 +46,7 @@ class DatabaseInfluxDB1x extends Database {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
getRetentionPolicyForDB(dbname, callback) {
|
|
49
|
-
this.connection.query(
|
|
49
|
+
this.connection.query(`SHOW RETENTION POLICIES ON "${dbname}"`, (err, rows) => {
|
|
50
50
|
if(err){
|
|
51
51
|
this.log.error(`Error retrieving retention policy: ${err}`);
|
|
52
52
|
callback(err, null);
|
|
@@ -56,9 +56,10 @@ class DatabaseInfluxDB1x extends Database {
|
|
|
56
56
|
rows[0].forEach(row => {
|
|
57
57
|
if (row.default) {
|
|
58
58
|
const regMatch = row.duration.match(regex);
|
|
59
|
-
const retHours = parseInt(regMatch[1]);
|
|
60
|
-
const retMinutes = parseInt(regMatch[2]);
|
|
61
|
-
const retSeconds = parseInt(regMatch[3]);
|
|
59
|
+
const retHours = parseInt(regMatch[1]) || 0;
|
|
60
|
+
const retMinutes = parseInt(regMatch[2]) || 0;
|
|
61
|
+
const retSeconds = parseInt(regMatch[3]) || 0;
|
|
62
|
+
this.log.debug (`Extracted retention time for ${dbname} - Hours: ${retHours} Minutes: ${retMinutes} Seconds: ${retSeconds}`);
|
|
62
63
|
retentionTime = retHours * 60 * 60 + retMinutes * 60 + retSeconds;
|
|
63
64
|
retentionName = row.name;
|
|
64
65
|
}
|
|
@@ -86,12 +87,16 @@ class DatabaseInfluxDB1x extends Database {
|
|
|
86
87
|
const shardDuration = this.calculateShardGroupDuration(retention);
|
|
87
88
|
|
|
88
89
|
// Get name of currently active default policy first, to update only it.
|
|
90
|
+
// Excodibur: As for new DBs Influx 1 creates "autogen" policy by default, is is unlikely that there is a scenario
|
|
91
|
+
// where the policy needs to be CREATEd from scratch, since there is always one set. Just keeping it in
|
|
92
|
+
// here for perhaps unknown config-scenarios.
|
|
93
|
+
const command = oldRetention.name ? 'ALTER' : 'CREATE';
|
|
94
|
+
this.log.debug(`Retention policy will be ${command}ed`);
|
|
89
95
|
|
|
90
|
-
const command = oldRetention.time ? 'ALTER' : 'CREATE';
|
|
91
96
|
const retentionName = oldRetention.name ? oldRetention.name : 'global';
|
|
92
97
|
|
|
93
98
|
this.log.info(`Applying retention policy (${retentionName}) for ${dbname} to ${retention === 0 ? 'infinity' : retention + ' seconds'}. Shard Duration: ${shardDuration} seconds`);
|
|
94
|
-
this.connection.query(`${command} RETENTION POLICY "${retentionName}" ON ${dbname} DURATION ${retention}s REPLICATION 1 SHARD DURATION ${shardDuration}s DEFAULT`, callback);
|
|
99
|
+
this.connection.query(`${command} RETENTION POLICY "${retentionName}" ON "${dbname}" DURATION ${retention}s REPLICATION 1 SHARD DURATION ${shardDuration}s DEFAULT`, callback);
|
|
95
100
|
});
|
|
96
101
|
}
|
|
97
102
|
|
|
@@ -46,7 +46,7 @@ class DatabaseInfluxDB2x extends Database {
|
|
|
46
46
|
connect() {
|
|
47
47
|
const url = `${this.protocol}://${this.host}:${this.port}/`;
|
|
48
48
|
|
|
49
|
-
this.log.debug(`Connect
|
|
49
|
+
this.log.debug(`Connect InfluxDB2: ${url} [${this.database}]`);
|
|
50
50
|
|
|
51
51
|
this.connection = new InfluxClient.InfluxDB({
|
|
52
52
|
url,
|
|
@@ -115,7 +115,7 @@ class DatabaseInfluxDB2x extends Database {
|
|
|
115
115
|
bucketID: this.bucketIds[dbname],
|
|
116
116
|
body: {
|
|
117
117
|
retentionRules: [{
|
|
118
|
-
type:
|
|
118
|
+
type: 'expire',
|
|
119
119
|
everySeconds: parseInt(retention),
|
|
120
120
|
shardGroupDurationSeconds: shardGroupDuration
|
|
121
121
|
}]
|
package/main.js
CHANGED
|
@@ -187,16 +187,6 @@ function startAdapter(options) {
|
|
|
187
187
|
return adapter;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
process.on('SIGINT', () => adapter && adapter.setState && finish(adapter));
|
|
191
|
-
process.on('SIGTERM', () => adapter && adapter.setState && finish(adapter));
|
|
192
|
-
|
|
193
|
-
process.on('uncaughtException', err => {
|
|
194
|
-
adapter.log.warn('Exception: ' + err);
|
|
195
|
-
if (adapter && adapter.setState) {
|
|
196
|
-
finish(adapter);
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
|
|
200
190
|
function setConnected(adapter, isConnected) {
|
|
201
191
|
if (adapter._connected !== isConnected) {
|
|
202
192
|
adapter._connected = isConnected;
|
|
@@ -1222,7 +1212,7 @@ function _delete(adapter, id, state, cb) {
|
|
|
1222
1212
|
adapter._client.query(query, err => {
|
|
1223
1213
|
if (err) {
|
|
1224
1214
|
adapter.log.warn(`Error on delete("${query}): ${err} / ${JSON.stringify(err.message)}"`);
|
|
1225
|
-
cb(err);
|
|
1215
|
+
cb && cb(err);
|
|
1226
1216
|
} else {
|
|
1227
1217
|
setConnected(adapter, true);
|
|
1228
1218
|
}
|
|
@@ -1384,7 +1374,7 @@ function update(adapter, id, state, cb) {
|
|
|
1384
1374
|
adapter._client.query(query, (err, result) => {
|
|
1385
1375
|
if (err) {
|
|
1386
1376
|
adapter.log.warn(`Error on update("${query}): ${err} / ${JSON.stringify(err.message)}"`);
|
|
1387
|
-
cb(err);
|
|
1377
|
+
cb && cb(err);
|
|
1388
1378
|
} else {
|
|
1389
1379
|
setConnected(adapter, true);
|
|
1390
1380
|
|
|
@@ -1409,7 +1399,7 @@ function update(adapter, id, state, cb) {
|
|
|
1409
1399
|
_delete(adapter, id, {ts: stored.ts}, error => {
|
|
1410
1400
|
if (error) {
|
|
1411
1401
|
adapter.log.error(`Cannot delete value for ${id}: ${JSON.stringify(state)}`);
|
|
1412
|
-
cb(err);
|
|
1402
|
+
cb && cb(err);
|
|
1413
1403
|
} else {
|
|
1414
1404
|
pushValueIntoDB(adapter, id, stored);
|
|
1415
1405
|
cb && cb();
|
|
@@ -1872,8 +1862,9 @@ function getHistoryIflx2(adapter, msg) {
|
|
|
1872
1862
|
adapter._client.query(booleanTypeCheckQuery, (error, _rslt) => {
|
|
1873
1863
|
let isBoolean;
|
|
1874
1864
|
if (error) {
|
|
1875
|
-
if (error.message.
|
|
1865
|
+
if (error.message.includes('type conflict: bool')) {
|
|
1876
1866
|
isBoolean = false;
|
|
1867
|
+
error = null;
|
|
1877
1868
|
} else {
|
|
1878
1869
|
return adapter.sendTo(msg.from, msg.command, {
|
|
1879
1870
|
result: [],
|