CCI-Tools / cate

ESA CCI Toolbox (Cate)
MIT License
50 stars 15 forks source link

Notify service clients about upcoming auto-stop #1026

Closed forman closed 2 years ago

forman commented 2 years ago

This is the backend counterpart for https://github.com/CCI-Tools/cate-app/issues/164.

Expected behavior

Users of the Cate App backend service should be informed about upcoming auto-shutdown due to inactivity, given that auto-shutdown has been enabled for the service (e.g. cate-webapi-start --auto-stop-after 3600 ...).

Actual behavior

The service stops without notification just leaving a log message.

Steps to reproduce the problem

  1. Run cate-webapi-start --auto-stop-after 100 ... on localhost.
  2. Start Cate App for local service.
  3. In Cate App do nothing else, just wait for "Connection closed" message.

Implementation

Use WebSocket to send JSON RPC message to clients containing time left until auto-close service and time of service inactivity.

Specifications

Cate 3.1.1, Cate App 3.1.0