refact(servers): Cleanup redundant if else (#1741)

pull/1742/head
Louis Ruch 4 years ago committed by GitHub
parent e360e162b9
commit 9bec68f32c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -95,19 +95,16 @@ func (j *sessionCleanupJob) Run(ctx context.Context) error {
return errors.Wrap(ctx, err, op)
}
if len(results) < 1 {
} else {
for _, result := range results {
event.WriteError(ctx, op, stderrors.New("worker has not reported status within acceptable grace period, all connections closed"),
event.WithInfo(
"private_id", result.ServerId,
"update_time", result.LastUpdateTime,
"grace_period_seconds", j.gracePeriod,
"number_connections_closed", result.NumberConnectionsClosed,
))
j.totalClosed += result.NumberConnectionsClosed
}
for _, result := range results {
event.WriteError(ctx, op, stderrors.New("worker has not reported status within acceptable grace period, all connections closed"),
event.WithInfo(
"private_id", result.ServerId,
"update_time", result.LastUpdateTime,
"grace_period_seconds", j.gracePeriod,
"number_connections_closed", result.NumberConnectionsClosed,
))
j.totalClosed += result.NumberConnectionsClosed
}
return nil

Loading…
Cancel
Save