chore(repo): initialize Tradarr repository

Add the existing application baseline and repository documentation/ignore rules.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 18:38:53 +01:00
commit 1b0625f91c
115 changed files with 18728 additions and 0 deletions

View File

@ -0,0 +1,37 @@
package ai
import (
"context"
"sync"
)
// ReportManager tracks in-flight report goroutines so they can be cancelled.
type ReportManager struct {
mu sync.Mutex
cancels map[string]context.CancelFunc
}
func NewReportManager() *ReportManager {
return &ReportManager{cancels: make(map[string]context.CancelFunc)}
}
func (m *ReportManager) Register(id string, cancel context.CancelFunc) {
m.mu.Lock()
defer m.mu.Unlock()
m.cancels[id] = cancel
}
func (m *ReportManager) Cancel(id string) {
m.mu.Lock()
defer m.mu.Unlock()
if cancel, ok := m.cancels[id]; ok {
cancel()
delete(m.cancels, id)
}
}
func (m *ReportManager) Remove(id string) {
m.mu.Lock()
defer m.mu.Unlock()
delete(m.cancels, id)
}