(ctx context.Context, param params.InstanceUpdateMessage)
| 947 | } |
| 948 | |
| 949 | func (r *Runner) AddInstanceStatusMessage(ctx context.Context, param params.InstanceUpdateMessage) error { |
| 950 | instanceName := auth.InstanceName(ctx) |
| 951 | if instanceName == "" { |
| 952 | return runnerErrors.ErrUnauthorized |
| 953 | } |
| 954 | |
| 955 | if err := r.store.AddInstanceEvent(ctx, instanceName, params.StatusEvent, params.EventInfo, param.Message); err != nil { |
| 956 | return fmt.Errorf("error adding status update: %w", err) |
| 957 | } |
| 958 | |
| 959 | updateParams := params.UpdateInstanceParams{ |
| 960 | RunnerStatus: param.Status, |
| 961 | } |
| 962 | |
| 963 | if param.AgentID != nil { |
| 964 | updateParams.AgentID = *param.AgentID |
| 965 | } |
| 966 | |
| 967 | if _, err := r.store.UpdateInstance(r.ctx, instanceName, updateParams); err != nil { |
| 968 | return fmt.Errorf("error updating runner agent ID: %w", err) |
| 969 | } |
| 970 | |
| 971 | return nil |
| 972 | } |
| 973 | |
| 974 | func (r *Runner) UpdateSystemInfo(ctx context.Context, param params.UpdateSystemInfoParams) error { |
| 975 | instanceName := auth.InstanceName(ctx) |
nothing calls this directly
no test coverage detected