Realign the structs to decrease memory footprint.

Add the timeout settings to address the connection drops.
This commit is contained in:
2023-12-14 17:16:38 +00:00
parent cd9c650226
commit b19b17b7c4
6 changed files with 40 additions and 48 deletions
+4 -4
View File
@@ -21,9 +21,9 @@ func StartHTTPProxy() {
server := fiber.New(fiber.Config{
DisableStartupMessage: true,
AppName: fmt.Sprintf("GraphQL Monitoring Proxy - %s v%s", libpack_config.PKG_NAME, libpack_config.PKG_VERSION),
IdleTimeout: time.Second * 60,
ReadTimeout: time.Second * 60,
WriteTimeout: time.Second * 60,
IdleTimeout: time.Duration(cfg.Client.ClientTimeout) * time.Second * 2,
ReadTimeout: time.Duration(cfg.Client.ClientTimeout) * time.Second * 2,
WriteTimeout: time.Duration(cfg.Client.ClientTimeout) * time.Second * 2,
})
server.Use(cors.New(cors.Config{
@@ -154,7 +154,7 @@ func processGraphQLRequest(c *fiber.Ctx) error {
timeTaken := time.Since(startTime)
// Logging & Monitoring
go logAndMonitorRequest(c, extractedUserID, opType, opName, wasCached, timeTaken, startTime)
logAndMonitorRequest(c, extractedUserID, opType, opName, wasCached, timeTaken, startTime)
return nil
}