Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove unused fields #3702

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading