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

Method handleEvent

workers/cache/cache.go:517–543  ·  view source on GitHub ↗
(event common.ChangePayload)

Source from the content-addressed store, hash-verified

515}
516
517func (w *Worker) handleEvent(event common.ChangePayload) {
518 slog.DebugContext(w.ctx, "handling event", "event_entity_type", event.EntityType, "event_operation", event.Operation)
519 switch event.EntityType {
520 case common.PoolEntityType:
521 w.handlePoolEvent(event)
522 case common.ScaleSetEntityType:
523 w.handleScaleSetEvent(event)
524 case common.InstanceEntityType:
525 w.handleInstanceEvent(event)
526 case common.RepositoryEntityType:
527 w.handleRepositoryEvent(event)
528 case common.OrganizationEntityType:
529 w.handleOrgEvent(event)
530 case common.EnterpriseEntityType:
531 w.handleEnterpriseEvent(event)
532 case common.GithubCredentialsEntityType, common.GiteaCredentialsEntityType:
533 w.handleCredentialsEvent(event)
534 case common.ControllerEntityType:
535 w.handleControllerInfoEvent(event)
536 case common.TemplateEntityType:
537 w.handleTemplateEvent(event)
538 case common.GithubEndpointEntityType:
539 w.handleEndpointEvent(event)
540 default:
541 slog.DebugContext(w.ctx, "unknown entity type", "entity_type", event.EntityType)
542 }
543}
544
545func (w *Worker) loop() {
546 defer w.Stop()

Callers 1

loopMethod · 0.95

Calls 10

handlePoolEventMethod · 0.95
handleScaleSetEventMethod · 0.95
handleInstanceEventMethod · 0.95
handleRepositoryEventMethod · 0.95
handleOrgEventMethod · 0.95
handleEnterpriseEventMethod · 0.95
handleTemplateEventMethod · 0.95
handleEndpointEventMethod · 0.95

Tested by

no test coverage detected