Skip to content

Commit

Permalink
chore: remove unused fields (#3702)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
stuartwdouglas and github-actions[bot] authored Dec 10, 2024
1 parent 551a650 commit 8638cfe
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 31 deletions.
44 changes: 15 additions & 29 deletions backend/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,36 +175,24 @@ 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

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
}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion backend/protos/xyz/block/ftl/pubsub/v1/pubsub.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8638cfe

Please sign in to comment.