address op state review feedback (#2453)
* address op state review feedback
This commit is contained in:
1 parent
c73a13aa3e
commit
821d8317dc
6 files changed
+122
-55
No files matched your search
@@ -164,7 +164,7 @@ func lookupWorker(ctx context.Context, reader db.Reader, id string) (*Worker, er
|
||||
// then the last status update time is ignored.
|
||||
// If WithLimit < 0, then unlimited results are returned. If WithLimit == 0, then
|
||||
// default limits are used for results.
|
||||
// Also supports: WithWorkerType, WithExcludeShutdownWorkers
|
||||
// Also supports: WithWorkerType, WithActiveWorkers
|
||||
func (r *Repository) ListWorkers(ctx context.Context, scopeIds []string, opt ...Option) ([]*Worker, error) {
|
||||
const op = "server.(Repository).ListWorkers"
|
||||
switch {
|
||||
@@ -197,9 +197,9 @@ func (r *Repository) ListWorkers(ctx context.Context, scopeIds []string, opt ...
|
||||
return nil, errors.New(ctx, errors.InvalidParameter, op, fmt.Sprintf("unknown worker type %v", opts.withWorkerType))
|
||||
}
|
||||
|
||||
if opts.withExcludeShutdownWorkers {
|
||||
where = append(where, "operational_state not in (?)")
|
||||
whereArgs = append(whereArgs, ShutdownOperationalState.String())
|
||||
if opts.withActiveWorkers {
|
||||
where = append(where, "operational_state = ?")
|
||||
whereArgs = append(whereArgs, ActiveOperationalState.String())
|
||||
}
|
||||
|
||||
limit := r.defaultLimit
|
||||
|
||||
Reference in new issue
Block a user