From 23593a5f6e32d2fe26e71c0a72f66458cab854b9 Mon Sep 17 00:00:00 2001 From: timoj Date: Fri, 19 Mar 2021 21:00:23 +0100 Subject: [PATCH] bugfix siridb conn update --- CHANGELOG.md | 8 +++++++- lib/serverstate.py | 11 ++++++----- version.py | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 367a5a5..68cec77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] - yyyy-mm-dd - + +## [0.1.0-beta2.1.1] - 2021-03-19 + +### Fixed + +- Fixed siridb connection status update for subscribers socket.io before socket.io is setup + ## [0.1.0-beta2.1] - 2021-03-17 Migration: series config's are changed completely. Removing series.json from the data folder is necessary. You will need to re-add the series after this. diff --git a/lib/serverstate.py b/lib/serverstate.py index b43f606..bacdfd8 100644 --- a/lib/serverstate.py +++ b/lib/serverstate.py @@ -98,11 +98,12 @@ async def refresh_siridb_status(cls): if status != cls.siridb_conn_status: cls.siridb_conn_status = status - await cls.sio.emit('update', { - 'resource': 'siridb_status', - 'updateType': SUBSCRIPTION_CHANGE_TYPE_INITIAL, - 'resourceData': cls.siridb_conn_status - }, room='siridb_status_updates') + if cls.sio is not None: + await cls.sio.emit('update', { + 'resource': 'siridb_status', + 'updateType': SUBSCRIPTION_CHANGE_TYPE_INITIAL, + 'resourceData': cls.siridb_conn_status + }, room='siridb_status_updates') @classmethod def stop(cls): diff --git a/version.py b/version.py index 8635045..256521a 100644 --- a/version.py +++ b/version.py @@ -1 +1 @@ -VERSION = '0.1.0-beta2.1' \ No newline at end of file +VERSION = '0.1.0-beta2.1.1' \ No newline at end of file