| 23 | } |
| 24 | |
| 25 | func (a *ApplicationClient) Online(ctx context.Context, applications ...*gateway.ApplicationRelease) error { |
| 26 | err := a.client.Begin(ctx) |
| 27 | if err != nil { |
| 28 | return err |
| 29 | } |
| 30 | for _, app := range applications { |
| 31 | err = a.client.Set(ctx, genWorkerID(app.ID, gateway.ProfessionApplication), a.toApinto(app)) |
| 32 | if err != nil { |
| 33 | a.client.Rollback(ctx) |
| 34 | return err |
| 35 | } |
| 36 | } |
| 37 | return a.client.Commit(ctx) |
| 38 | } |
| 39 | |
| 40 | func (a *ApplicationClient) Offline(ctx context.Context, applications ...*gateway.ApplicationRelease) error { |
| 41 | err := a.client.Begin(ctx) |