You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently API calls agent server in direct manner, using model files and db connection.
What I consider to refactor
Create AgentServerClient and 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
4 API handlers have similar code for fetching modules - /agents, /agents/hash, /groups, /groups/hash. This needs caching too, probably on AgentServerClient level
The text was updated successfully, but these errors were encountered:
Currently API calls agent server in direct manner, using model files and db connection.
What I consider to refactor
AgentServerClient
and 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.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.AgentServerClient
levelThe text was updated successfully, but these errors were encountered: