feat: upload to external services clublog qrz
This commit is contained in:
@@ -88,16 +88,21 @@ func (m *Manager) Lookup(ctx context.Context, callsign string) (Result, error) {
|
||||
return Result{}, fmt.Errorf("empty callsign")
|
||||
}
|
||||
|
||||
if r, ok := m.cache.Get(ctx, call); ok {
|
||||
r.Source = "cache"
|
||||
return r, nil
|
||||
}
|
||||
|
||||
m.mu.RLock()
|
||||
providers := append([]Provider(nil), m.providers...)
|
||||
dxcc := m.dxcc
|
||||
m.mu.RUnlock()
|
||||
|
||||
if r, ok := m.cache.Get(ctx, call); ok {
|
||||
r.Source = "cache"
|
||||
// Re-assert the authoritative DXCC fields (country/zones/continent)
|
||||
// from cty.dat on every cache hit — cheap (in-memory) and lets a
|
||||
// corrected entity mapping (e.g. Sicily → Italy) heal stale cached
|
||||
// rows without waiting for the TTL to expire.
|
||||
fillFromDXCC(&r, dxcc)
|
||||
return r, nil
|
||||
}
|
||||
|
||||
var lastErr error
|
||||
for _, p := range providers {
|
||||
r, err := p.Lookup(ctx, call)
|
||||
|
||||
Reference in New Issue
Block a user