Skip to content

Commit

Permalink
Merge pull request #32 from dkleber89/clearTimeOut
Browse files Browse the repository at this point in the history
Clear Timeout on Adapter unload and increase Adapter Version
  • Loading branch information
dkleber89 authored May 30, 2020
2 parents 3e63ce4 + 0d16de4 commit d65a95d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 20 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ Upload your *.tpy File from your PLC Project -> Every Time you change something
3. Sync never meant the Dataexchange of the Symbols. Sync is the create or delete the States in ioBroker dependent on the GlobalVariableTable in the PLC.

## Changelog
### 1.2.2 (2020-05-30)

- (dkleber89) Clear reconnectTimeout on Adapter unload;

### 1.2.1 (2020-04-20)

- (dkleber89) Add CI over Github Actions; Update Dependencies;
Expand Down Expand Up @@ -110,10 +114,6 @@ Upload your *.tpy File from your PLC Project -> Every Time you change something
- (Appollon77) Core Files/Testing Update and introduce adapter-core
- (dkleber89) Fix Problem 'write after End'

### 0.2.2 (2019-02-11)

- (dkleber89) DEBUG Version -> Still Problems with 'write after end'


## License

Expand Down
5 changes: 4 additions & 1 deletion beckhoff.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ let adsClient = null;
let checkPlcStateInterval = null;
let oldConnectionState = false;
let oldPlcState = false;
let reconnectTimeout = null;

let adapter;

Expand Down Expand Up @@ -41,6 +42,8 @@ function startAdapter(options) {
adapter.on('unload', cb => {
emitter.removeAllListeners();

clearTimeout(reconnectTimeout);

if (adsClient !== null) {
adsClient.end(() => {
adsClient = null;
Expand Down Expand Up @@ -212,7 +215,7 @@ function endConnReconnect() {

adapter.log.info(`Try to reconnect in ${adapter.config.reconnectInterval} seconds`);

setTimeout(() => {
reconnectTimeout = setTimeout(() => {
timeAlreadyRunning = false;

emitter.emit('reConnect');
Expand Down
26 changes: 13 additions & 13 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
{
"common": {
"name": "beckhoff",
"version": "1.2.1",
"version": "1.2.2",
"news": {
"0.2.2": {
"en": "Debug Version - Send log on 'write after end' error. Issue #2",
"de": "Debug Version - Bei 'write after end' fehler log schicken. Issue #2",
"ru": "Отладочная версия - отправить отчет на пишу после ошибки конец'. Выпуск #2",
"pt": "Versão de depuração - Envio de log em \"escrever depois de terminar um erro\". Edição #2",
"nl": "Debug Versie - log op 'schrijf na afloop van de' fout. Probleem #2",
"fr": "Version Debug - Envoyer connectez-vous à \"écrire après la fin' erreur. Question #2",
"it": "Versione di Debug - Inviare l'accesso 'scrivere dopo la fine' di errore. Problema #2",
"es": "Versión de depuración - Envío de registro en \"escribir después del final de' error. Problema #2",
"pl": "Za wersja - wyślij raport na piszę po błędu koniec'. Odcinek #2",
"zh-cn": "调试版本分发的日志上写之后结束的'误差。 第2个问题"
},
"0.3.0": {
"en": "New Core- and Testfiles from Apollon77 and fix 'write after end'. Issue #2",
"de": "Neue Core- and Testfiles von Apollon77 und Lösung für das 'write after end' Problem. Issue #2",
Expand Down Expand Up @@ -146,6 +134,18 @@
"es": "Agregar CI sobre acciones de Github; ",
"pl": "Dodaj CI ponad Akcje Github; ",
"zh-cn": "通过Github Action添加CI;"
},
"1.2.2": {
"en": "Clear reconnectTimeout on Adapter unload",
"de": "Löschen des reconnectTimeout wenn der Adapter gestoppt wird",
"ru": "Очистить ReconnectTimeout при выгрузке адаптера",
"pt": "Limpar reconnectTimeout ao descarregar o adaptador",
"nl": "Clear reconnectTimeout on Adapter unload",
"fr": "Effacer reconnectTimeout lors du déchargement de l'adaptateur",
"it": "Cancella reconnectTimeout allo scaricamento dell'adattatore",
"es": "Borrar reconectTimeout en la descarga del adaptador",
"pl": "Wyczyść reconnectTimeout przy rozładowaniu adaptera",
"zh-cn": "清除适配器卸载时的reconnectTimeout"
}
},
"title": "Beckhoff TwinCat ADS",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "iobroker.beckhoff",
"description": "ioBroker Beckoff Adapter to communicate with a Beckhoff PLC",
"version": "1.2.1",
"version": "1.2.2",
"private": false,
"license": "MIT",
"keywords": [
Expand Down

0 comments on commit d65a95d

Please sign in to comment.