Some countries folders do not have ipv6 file

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-07 13:02:58 +04:00
parent 597d00d535
commit dd6db7ca21

View File

@@ -17,6 +17,7 @@ package geoloc
import (
"bufio"
"context"
"errors"
"fmt"
"net"
"os"
@@ -60,6 +61,9 @@ func (s *Service) ImportFromDir(ctx context.Context, dataDir string) error {
path := filepath.Join(countryDir, entry.Name(), filename)
cidrs, err := parseCIDRFile(path)
if errors.Is(err, os.ErrNotExist) {
continue
}
if err != nil {
return fmt.Errorf("cannot parse CIDR file %s: %w", path, err)
}