Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
jkralik committed Sep 28, 2023
1 parent f472572 commit 4fd79ce
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ In the context of managing CoAP gateways and their associated devices, the proce

1. **Generating Unique Service ID**: Each instance of a CoAP gateway initiates with a unique ID, generated during startup. These IDs are stored in a database for reference and are also associated with the metadata of each device.

2. **Sending Heartbeat**: Periodically, each CoAP gateway sends a heartbeat using the [UpdateServiceMetadata command](https://github.com/plgd-dev/hub/blob/main/resource-aggregate/pb/commands.proto#L668) to update the heartbeat entries managed by the Resource Aggregate. This request includes the service ID, [time to live (TTL)](https://github.com/plgd-dev/hub/blob/main/charts/plgd-hub/values.yaml#L887), and a timestamp indicating when the request was created. The request is transformed into an event after it's successfully stored in the event store. During command-to-event transformation, the Resource Aggregate calculates the `heartbeatValidUntil` based on the time to live and the duration of the request. If the latest heartbeats are no longer valid, they are set in the new event as expired.
In case the heartbeat update came too late - the previous one already expired and it's present in the expired list, the update operation fails and the requesting CoAP Gateway is terminated by sending a self-destruct signal - SIGTERM.
2. **Sending Heartbeat**: Periodically, each CoAP gateway sends a heartbeat using the [UpdateServiceMetadata command](https://github.com/plgd-dev/hub/blob/main/resource-aggregate/pb/commands.proto#L668) to update the heartbeat entries managed by the Resource Aggregate. This request includes the service ID, [time to live (TTL)](https://github.com/plgd-dev/hub/blob/main/charts/plgd-hub/values.yaml#L887), and a timestamp indicating when the request was created. The request is transformed into an event after it's successfully stored in the event store. During command-to-event transformation, the Resource Aggregate calculates the `heartbeatValidUntil` based on the time to live and the duration of the request. If the latest heartbeats are no longer valid, they are set in the new event as expired.

In case the heartbeat update came too late - the previous one already expired and it's present in the expired list, the update operation fails and the requesting CoAP Gateway is terminated by sending a self-destruct signal - SIGTERM.

{{< warning >}}

Expand Down

0 comments on commit 4fd79ce

Please sign in to comment.