From 8638cfe7c9113a64fd4450c0c69d270e2b34a092 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Wed, 11 Dec 2024 07:32:35 +1100 Subject: [PATCH] chore: remove unused fields (#3702) Co-authored-by: github-actions[bot] --- backend/controller/controller.go | 44 +++++++------------ .../xyz/block/ftl/pubsub/v1/pubsub.proto | 2 +- .../xyz/block/ftl/pubsub/v1/pubsub_connect.ts | 2 +- 3 files changed, 17 insertions(+), 31 deletions(-) diff --git a/backend/controller/controller.go b/backend/controller/controller.go index f5187d6d8b..cc0da653c4 100644 --- a/backend/controller/controller.go +++ b/backend/controller/controller.go @@ -175,14 +175,7 @@ type clients struct { verb ftlv1connect.VerbServiceClient } -// ControllerListListener is regularly notified of the current list of controllers -// This is often used to update a hash ring to distribute work. -type ControllerListListener interface { - UpdatedControllerList(ctx context.Context, controllers []state.Controller) -} - type Service struct { - conn *sql.DB leaser leases.Leaser key model.ControllerKey deploymentLogsSink *deploymentLogsSink @@ -190,21 +183,16 @@ type Service struct { cm *cf.Manager[configuration.Configuration] sm *cf.Manager[configuration.Secrets] - tasks *scheduledtask.Scheduler - pubSub *pubsub.Service - storage *artefacts.OCIArtefactService - controllerListListeners []ControllerListListener + tasks *scheduledtask.Scheduler + pubSub *pubsub.Service + storage *artefacts.OCIArtefactService // Map from runnerKey.String() to client. - clients *ttlcache.Cache[string, clients] - - schemaSyncLock sync.Mutex + clients *ttlcache.Cache[string, clients] + clientLock sync.Mutex config Config - increaseReplicaFailures map[string]int - - clientLock sync.Mutex routeTable *routing.RouteTable controllerState state.ControllerState } @@ -236,18 +224,16 @@ func New( routingTable := routing.New(ctx, schemaeventsource.New(ctx, rpc.ClientFromContext[ftlv1connect.SchemaServiceClient](ctx))) svc := &Service{ - cm: cm, - sm: sm, - tasks: scheduler, - leaser: ldb, - conn: conn, - key: key, - clients: ttlcache.New(ttlcache.WithTTL[string, clients](time.Minute)), - config: config, - increaseReplicaFailures: map[string]int{}, - routeTable: routingTable, - storage: storage, - controllerState: state.NewInMemoryState(), + cm: cm, + sm: sm, + tasks: scheduler, + leaser: ldb, + key: key, + clients: ttlcache.New(ttlcache.WithTTL[string, clients](time.Minute)), + config: config, + routeTable: routingTable, + storage: storage, + controllerState: state.NewInMemoryState(), } pubSub := pubsub.New(ctx, conn, routingTable, svc.controllerState) diff --git a/backend/protos/xyz/block/ftl/pubsub/v1/pubsub.proto b/backend/protos/xyz/block/ftl/pubsub/v1/pubsub.proto index 2b09630de0..d1cd43c975 100644 --- a/backend/protos/xyz/block/ftl/pubsub/v1/pubsub.proto +++ b/backend/protos/xyz/block/ftl/pubsub/v1/pubsub.proto @@ -22,7 +22,7 @@ message ResetSubscriptionRequest { } message ResetSubscriptionResponse {} -// ModuleService is the service that modules use to interact with the Controller. +// LegacyPubsubService is the service that modules use to interact with the Controller. service LegacyPubsubService { // Ping service for readiness. rpc Ping(xyz.block.ftl.v1.PingRequest) returns (xyz.block.ftl.v1.PingResponse) { diff --git a/frontend/console/src/protos/xyz/block/ftl/pubsub/v1/pubsub_connect.ts b/frontend/console/src/protos/xyz/block/ftl/pubsub/v1/pubsub_connect.ts index 25fd20875b..2932c38b96 100644 --- a/frontend/console/src/protos/xyz/block/ftl/pubsub/v1/pubsub_connect.ts +++ b/frontend/console/src/protos/xyz/block/ftl/pubsub/v1/pubsub_connect.ts @@ -8,7 +8,7 @@ import { MethodIdempotency, MethodKind } from "@bufbuild/protobuf"; import { PublishEventRequest, PublishEventResponse, ResetSubscriptionRequest, ResetSubscriptionResponse } from "./pubsub_pb.js"; /** - * ModuleService is the service that modules use to interact with the Controller. + * LegacyPubsubService is the service that modules use to interact with the Controller. * * @generated from service xyz.block.ftl.pubsub.v1.LegacyPubsubService */