| Conditions | 3 |
| Total Lines | 18 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package circuitbreaker |
||
| 25 | func (r *TenantReader) ListTenants(ctx context.Context, pagination database.Pagination) (tenants []*base.Tenant, ct database.EncodedContinuousToken, err error) { |
||
| 26 | type circuitBreakerResponse struct { |
||
| 27 | Tenants []*base.Tenant |
||
| 28 | Ct database.EncodedContinuousToken |
||
| 29 | } |
||
| 30 | |||
| 31 | response, err := r.cb.Execute(func() (interface{}, error) { |
||
| 32 | var err error |
||
| 33 | var resp circuitBreakerResponse |
||
| 34 | resp.Tenants, resp.Ct, err = r.delegate.ListTenants(ctx, pagination) |
||
| 35 | return resp, err |
||
| 36 | }) |
||
| 37 | if err != nil { |
||
| 38 | return nil, nil, err |
||
| 39 | } |
||
| 40 | |||
| 41 | resp := response.(circuitBreakerResponse) |
||
| 42 | return resp.Tenants, resp.Ct, nil |
||
| 43 | } |
||
| 44 |