Actually use cache
This commit is contained in:
@@ -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
|
||||
|
||||
7
main.go
7
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)
|
||||
|
||||
Reference in New Issue
Block a user