Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Commit

Permalink
closes #980
Browse files Browse the repository at this point in the history
  • Loading branch information
forman committed Apr 29, 2021
1 parent c7cd0bc commit 3c7182c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
7 changes: 6 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions cate/webapi/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 4 additions & 0 deletions tests/webapi/test_websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 3c7182c

Please sign in to comment.