MCPcopy Create free account
hub / github.com/cloudbase/garm / Update

Method Update

workers/provider/instance_manager.go:395–414  ·  view source on GitHub ↗
(instance dbCommon.ChangePayload)

Source from the content-addressed store, hash-verified

393}
394
395func (i *instanceManager) Update(instance dbCommon.ChangePayload) error {
396 if !i.running.Load() {
397 return runnerErrors.NewBadRequestError("instance manager is not running")
398 }
399
400 timer := time.NewTimer(10 * time.Second)
401 defer timer.Stop()
402
403 slog.DebugContext(i.ctx, "sending update to instance manager")
404 select {
405 case i.updates <- instance:
406 case <-i.quit:
407 return nil
408 case <-i.ctx.Done():
409 return nil
410 case <-timer.C:
411 return fmt.Errorf("timeout while sending update to instance manager")
412 }
413 return nil
414}
415
416func (i *instanceManager) updatesLoop() {
417 defer i.Stop()

Callers 3

CreateFileObjectMethod · 0.80
handleInstanceEventMethod · 0.80

Calls 2

StopMethod · 0.65
DoneMethod · 0.45