rename optout to lurEnabled for clarity (#3303)

This commit is contained in:
Michael Milton authored and GitHub committed 2023-06-09 12:41:12 -04:00
1 parent 929ede1c18
commit 7820af3924
2 files changed
+13 -16

No files matched your search

+2 -5
View File
@@ -14,7 +14,7 @@ import (
)
// RegisterJob registers the census job with the provided scheduler.
func RegisterJob(ctx context.Context, s *scheduler.Scheduler, optOut bool, r db.Reader, w db.Writer) error {
func RegisterJob(ctx context.Context, s *scheduler.Scheduler, lurEnabled bool, r db.Reader, w db.Writer) error {
const op = "census.RegisterJob"
if s == nil {
return errors.New(ctx, errors.InvalidParameter, "nil scheduler", op, errors.WithoutEvent())
@@ -25,11 +25,8 @@ func RegisterJob(ctx context.Context, s *scheduler.Scheduler, optOut bool, r db.
if util.IsNil(w) {
return errors.New(ctx, errors.Internal, "nil DB writer", op, errors.WithoutEvent())
}
if util.IsNil(optOut) {
return errors.New(ctx, errors.Internal, "nil opt out value", op, errors.WithoutEvent())
}
censusJob, err := NewCensusJobFn(ctx, optOut, r, w)
censusJob, err := NewCensusJobFn(ctx, lurEnabled, r, w)
if err != nil {
return fmt.Errorf("error creating census job: %w", err)
}
+11 -11
View File
@@ -18,14 +18,14 @@ var (
)
type censusJob struct {
r db.Reader
w db.Writer
optOut bool
agent any
eventCtx context.Context
r db.Reader
w db.Writer
lurEnabled bool
agent any
eventCtx context.Context
}
func newCensusJob(ctx context.Context, optOut bool, r db.Reader, w db.Writer) (*censusJob, error) {
func newCensusJob(ctx context.Context, lurEnabled bool, r db.Reader, w db.Writer) (*censusJob, error) {
const op = "censusJob.newCensusJob"
switch {
case r == nil:
@@ -35,11 +35,11 @@ func newCensusJob(ctx context.Context, optOut bool, r db.Reader, w db.Writer) (*
}
return &censusJob{
r: r,
w: w,
optOut: optOut,
agent: nil,
eventCtx: ctx,
r: r,
w: w,
lurEnabled: lurEnabled,
agent: nil,
eventCtx: ctx,
}, nil
}