-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
Currently API calls agent server in direct manner, using model files and db connection.
What I consider to refactor
- Create
AgentServerClientand pin all methods here, mimic for client-server communication. Under the hood it still will use models and direct DB connection, but we will refactor handlers and prepare client layer for future refactoring too, when server API will be ready. - Refactor cache layer for server connections (minio + mysql). Move this to client implementation.
- If we need to get data from server, we will do smth like
client := agentServerClient.WithWEndpoint(agentServerHash)and then return a connected client. It means that if we do not have connection, we create it now and put into cache. - Return proper error if server is not responding
- Remove connection if server was deleted using API method
- Create connection if server was added using API method
- Use mysql connnector with retry policy, already presented in mysql lib
- If we need to get data from server, we will do smth like
- 4 API handlers have similar code for fetching modules - /agents, /agents/hash, /groups, /groups/hash. This needs caching too, probably on
AgentServerClientlevel
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
🆕 New