-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove old
device_connections
in worker, remove connection state st…
…ored on `device` (#1807) - Introduce `device.latest_connection`, which references the latest `device_connection` record for the device - Start cleaning up `device_connections` every hour with `NervesHub.Workers.DeleteOldDeviceConnections` - This targets rows that have a `last_seen_at` older than two weeks by default (configurable), a `status` of `:disconnected` and does not delete a device's last `device_connection`, even if the previous criteria are met - Remove `connection_status`, `connection_established_at`, and `connection_last_seen_at` from the `device` schema. - Slot in `device.latest_connection`, simplifying a lot of queries and logic related to `device_connections` - Remove `Devices.clean_connection_states` and it's call from a worker since `device.connection_status` was removed and connection logic is moving to `device.latest_connection` - When a device connects to the socket, we set the created `device_connection` as `device.lastest_connection` - Create `device.latest_connection` when seeding devices Todo: - [x] check filtering UI locally
- Loading branch information
Showing
22 changed files
with
225 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.