@@ -44,12 +44,12 @@ import (
4444// when that fact is green advances the queue's last-green bookmark and promotes
4545// the commit. Implements consumer.Controller.
4646type Controller struct {
47- logger * zap.SugaredLogger
48- metricsScope tally.Scope
49- stores storage.Factory
50- sourceControls sourcecontrol.Factory
51- topicKey consumer.TopicKey
52- consumerGroup string
47+ logger * zap.SugaredLogger
48+ metricsScope tally.Scope
49+ stores storage.Factory
50+ sourceControl sourcecontrol.Factory
51+ topicKey consumer.TopicKey
52+ consumerGroup string
5353}
5454
5555// Verify Controller implements consumer.Controller interface at compile time.
@@ -68,18 +68,18 @@ func NewController(
6868 logger * zap.SugaredLogger ,
6969 scope tally.Scope ,
7070 stores storage.Factory ,
71- sourceControls sourcecontrol.Factory ,
71+ sourceControl sourcecontrol.Factory ,
7272 topicKey consumer.TopicKey ,
7373 consumerGroup string ,
7474) * Controller {
7575 name := string (topicKey ) + "_controller"
7676 return & Controller {
77- logger : logger .Named (name ),
78- metricsScope : scope .SubScope (name ),
79- stores : stores ,
80- sourceControls : sourceControls ,
81- topicKey : topicKey ,
82- consumerGroup : consumerGroup ,
77+ logger : logger .Named (name ),
78+ metricsScope : scope .SubScope (name ),
79+ stores : stores ,
80+ sourceControl : sourceControl ,
81+ topicKey : topicKey ,
82+ consumerGroup : consumerGroup ,
8383 }
8484}
8585
@@ -247,7 +247,7 @@ func (c *Controller) reportFailureDetectionLatency(ctx context.Context, request
247247 return
248248 }
249249
250- sourceControl , err := c .sourceControls .For (sourcecontrol.Config {QueueName : request .Queue })
250+ sourceControl , err := c .sourceControl .For (sourcecontrol.Config {QueueName : request .Queue })
251251 if err != nil {
252252 c .failureDetectionUnobserved (request , "resolve_source_control" , err )
253253 return
@@ -366,7 +366,7 @@ func (c *Controller) advanceLastGreen(ctx context.Context, store storage.Storage
366366func (c * Controller ) emitLastGreenTimestamp (ctx context.Context , request entity.Request ) {
367367 queueTag := metrics .NewTag ("queue" , request .Queue )
368368
369- sourceControl , err := c .sourceControls .For (sourcecontrol.Config {QueueName : request .Queue })
369+ sourceControl , err := c .sourceControl .For (sourcecontrol.Config {QueueName : request .Queue })
370370 if err != nil {
371371 metrics .NamedCounter (c .metricsScope , _opName , "last_green_timestamp_resolve_errors" , 1 , queueTag )
372372 c .logger .Warnw ("failed to resolve source control to report the last green timestamp" ,
@@ -421,7 +421,7 @@ func (c *Controller) emitLastGreenTimestamp(ctx context.Context, request entity.
421421// harmlessly. A commit that a rewritten history dropped from the ref cannot be
422422// promoted by any retry, so that case is counted and skipped rather than failed.
423423func (c * Controller ) promote (ctx context.Context , request entity.Request ) error {
424- sc , err := c .sourceControls .For (sourcecontrol.Config {QueueName : request .Queue })
424+ sc , err := c .sourceControl .For (sourcecontrol.Config {QueueName : request .Queue })
425425 if err != nil {
426426 metrics .NamedCounter (c .metricsScope , _opName , "source_control_errors" , 1 ,
427427 metrics .NewTag ("stage" , "resolve" ),
0 commit comments