@@ -39,12 +39,12 @@ func (p *subcommandPauseIdentifier) Run(ctx context.Context, a *admin) error {
39
39
return errors .New ("the -batch-file flag is required" )
40
40
}
41
41
42
- identifiers , err := a .readPausedAccountFile (p .batchFile )
42
+ idents , err := a .readPausedAccountFile (p .batchFile )
43
43
if err != nil {
44
44
return err
45
45
}
46
46
47
- _ , err = a .pauseIdentifiers (ctx , identifiers , p .parallelism )
47
+ _ , err = a .pauseIdentifiers (ctx , idents , p .parallelism )
48
48
if err != nil {
49
49
return err
50
50
}
@@ -60,19 +60,19 @@ func (a *admin) pauseIdentifiers(ctx context.Context, entries []pauseCSVData, pa
60
60
return nil , errors .New ("cannot pause identifiers because no pauseData was sent" )
61
61
}
62
62
63
- accountToIdentifiers := make (map [int64 ][]* corepb.Identifier )
63
+ accountToIdents := make (map [int64 ][]* corepb.Identifier )
64
64
for _ , entry := range entries {
65
- accountToIdentifiers [entry .accountID ] = append (accountToIdentifiers [entry .accountID ], & corepb.Identifier {
65
+ accountToIdents [entry .accountID ] = append (accountToIdents [entry .accountID ], & corepb.Identifier {
66
66
Type : string (entry .identifierType ),
67
67
Value : entry .identifierValue ,
68
68
})
69
69
}
70
70
71
71
var errCount atomic.Uint64
72
- respChan := make (chan * sapb.PauseIdentifiersResponse , len (accountToIdentifiers ))
72
+ respChan := make (chan * sapb.PauseIdentifiersResponse , len (accountToIdents ))
73
73
work := make (chan struct {
74
- accountID int64
75
- identifiers []* corepb.Identifier
74
+ accountID int64
75
+ idents []* corepb.Identifier
76
76
}, parallelism )
77
77
78
78
var wg sync.WaitGroup
@@ -83,23 +83,23 @@ func (a *admin) pauseIdentifiers(ctx context.Context, entries []pauseCSVData, pa
83
83
for data := range work {
84
84
response , err := a .sac .PauseIdentifiers (ctx , & sapb.PauseRequest {
85
85
RegistrationID : data .accountID ,
86
- Identifiers : data .identifiers ,
86
+ Identifiers : data .idents ,
87
87
})
88
88
if err != nil {
89
89
errCount .Add (1 )
90
- a .log .Errf ("error pausing identifier(s) %q for account %d: %v" , data .identifiers , data .accountID , err )
90
+ a .log .Errf ("error pausing identifier(s) %q for account %d: %v" , data .idents , data .accountID , err )
91
91
} else {
92
92
respChan <- response
93
93
}
94
94
}
95
95
}()
96
96
}
97
97
98
- for accountID , identifiers := range accountToIdentifiers {
98
+ for accountID , idents := range accountToIdents {
99
99
work <- struct {
100
- accountID int64
101
- identifiers []* corepb.Identifier
102
- }{accountID , identifiers }
100
+ accountID int64
101
+ idents []* corepb.Identifier
102
+ }{accountID , idents }
103
103
}
104
104
close (work )
105
105
wg .Wait ()
0 commit comments