diff --git a/CHANGES.md b/CHANGES.md index 781790ee1..001ff94fc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,11 @@ +## Version 3.0.0 (in development) + +* Added a Web API function `keep_alive` that is periodically used by Cate App + to avoid loosing an open WebSocket connection. (#980) + ## Version 2.1.5 -* Fixed problem that prevented storing user preferences from Cate App if the +* Fixed a problem that prevented storing user preferences from Cate App if the preferences file did not yet exist. * The parameters of operation `temporal_aggregation` have been changed. Both parameters `output_resolution` and `custom_resolution` have been replaced by a single parameter diff --git a/cate/webapi/websocket.py b/cate/webapi/websocket.py index 1518dfaaf..456eb540f 100644 --- a/cate/webapi/websocket.py +++ b/cate/webapi/websocket.py @@ -74,6 +74,10 @@ def _serialize_workspace(self, workspace: Workspace) -> dict: self.workspace_manager.root_path) return workspace_json + def keep_alive(self): + """This operation is used to keep the WebSocket connection alive.""" + pass + def get_config(self) -> dict: return dict(data_stores_path=conf.get_data_stores_path(), use_workspace_imagery_cache=conf.get_use_workspace_imagery_cache(), diff --git a/tests/webapi/test_websocket.py b/tests/webapi/test_websocket.py index 36139638d..c5a440fed 100644 --- a/tests/webapi/test_websocket.py +++ b/tests/webapi/test_websocket.py @@ -28,6 +28,10 @@ def tearDown(self): if os.path.exists(self._workspace_dir): shutil.rmtree(self._workspace_dir) + @unittest.skipIf(os.environ.get('CATE_DISABLE_WEB_TESTS', None) == '1', 'CATE_DISABLE_WEB_TESTS = 1') + def test_keep_alive(self): + self.assertIsNone(self.service.keep_alive()) + @unittest.skipIf(os.environ.get('CATE_DISABLE_WEB_TESTS', None) == '1', 'CATE_DISABLE_WEB_TESTS = 1') def test_get_data_stores(self): data_stores = self.service.get_data_stores()