feat: Credo mediator clean up cron job#86
Conversation
Signed-off-by: jamshale <jamiehalebc@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR introduces a cron job tool for cleaning up stale mediated connections in a Credo mediator. The tool periodically removes connections that have been inactive for a configurable period, along with their associated records (DID records, mediation records, and push notification records).
Changes:
- Added
CredoMediatorCleanUpclass that implements automated cleanup of inactive connections based onlastSeenorupdatedAttimestamps - Integrated new
mediator-cleanupstrategy into the CLI with arguments for inactive threshold, start time, and interval - Updated documentation with usage instructions for the cleanup tool
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
| askar_tools/credo_mediator_clean_up.py | New module implementing the cleanup logic with cron scheduling functionality |
| askar_tools/main.py | Added CLI arguments and integration for the mediator-cleanup strategy |
| askar_tools/README.md | Added documentation section for the Credo Mediator Clean Up tool |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
Signed-off-by: jamshale <jamiehalebc@gmail.com>
esune
left a comment
There was a problem hiding this comment.
This is great work, thanks @jamshale !
Only a couple of questions/nitpicks before final approval.
As per our discussion, I am also thinking about having the cleanup funcrionality ported and incorporated as a feature of the Credo mediator itself to make it easier to maintain and discover since it would use the same tech stack as the mediator, and be closer to its code for future changes.
…if missing Signed-off-by: jamshale <jamiehalebc@gmail.com>
This is a tool used to remove old mediated connections when the have become stale. It requires the mediator tag connections with a
lastSeentag. It was arguments for the length of time a connection has become stale, when to start the first cleanup and the amount of days to wait before running the cleanup again.If a connection record is deleted from the mediator database the connection which used it will no longer work. The recipient agent will need to create a new mediated connection.
It also checks if the connection has queued messages. In this case it will not delete the mediation records.