From addb5773fe9dcd1f738be7d0f71d77fc04376709 Mon Sep 17 00:00:00 2001 From: PhatPhuckDave Date: Fri, 10 Oct 2025 22:54:56 +0200 Subject: [PATCH] Actually use cache --- esi/client.go | 12 ++++++------ main.go | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/esi/client.go b/esi/client.go index f939899..25a99ac 100644 --- a/esi/client.go +++ b/esi/client.go @@ -87,12 +87,12 @@ type FactoryDetails struct { } type Route struct { - ContentTypeID int `json:"content_type_id"` - DestinationPinID int `json:"destination_pin_id"` - Quantity int `json:"quantity"` - RouteID int `json:"route_id"` - SourcePinID int `json:"source_pin_id"` - Waypoints []int `json:"waypoints"` + ContentTypeID int `json:"content_type_id"` + DestinationPinID int `json:"destination_pin_id"` + Quantity float64 `json:"quantity"` + RouteID int `json:"route_id"` + SourcePinID int `json:"source_pin_id"` + Waypoints []int `json:"waypoints"` } // ESIInterface defines the contract for ESI API interactions diff --git a/main.go b/main.go index 59395a4..ec99ca5 100644 --- a/main.go +++ b/main.go @@ -64,11 +64,12 @@ func main() { // Configure SSO to use existing fasthttp router sso.SetRouter(r) - // Create ESI client - esiClient := esi.NewDirectESI() + // Create ESI client with caching + directESI := esi.NewDirectESI() + cachedESI := esi.NewCachedESI(directESI, database.Cache()) // Create route handler with dependencies - routeHandler := routes.NewRouteHandler(sso, webhook, esiClient) + routeHandler := routes.NewRouteHandler(sso, webhook, cachedESI) routeHandler.SetupRoutes(r) logger.Info("Starting web server on 0.0.0.0:%s", options.GlobalOptions.Port)