()
| 69 | } |
| 70 | |
| 71 | func (t *toolsUpdater) Start() error { |
| 72 | t.mux.Lock() |
| 73 | defer t.mux.Unlock() |
| 74 | |
| 75 | if t.running { |
| 76 | return nil |
| 77 | } |
| 78 | |
| 79 | t.running = true |
| 80 | t.quit = make(chan struct{}) |
| 81 | |
| 82 | slog.DebugContext(t.ctx, "starting tools updater", "entity", t.entity.String(), "forge_type", t.entity.Credentials.ForgeType) |
| 83 | |
| 84 | switch t.entity.Credentials.ForgeType { |
| 85 | case params.GithubEndpointType: |
| 86 | go t.loop() |
| 87 | case params.GiteaEndpointType: |
| 88 | go t.giteaUpdateLoop() |
| 89 | } |
| 90 | return nil |
| 91 | } |
| 92 | |
| 93 | func (t *toolsUpdater) Stop() error { |
| 94 | t.mux.Lock() |
nothing calls this directly
no test coverage detected