Fix geoloc ip country block imports

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-05-07 17:30:09 +04:00
parent a052d6f481
commit d0060f6d2c

View File

@@ -101,7 +101,11 @@ func (s *Service) ImportFromDir(ctx context.Context, dataDir string) error {
if err := s.pgClient.WithTx(
ctx,
func(ctx context.Context, tx pg.Tx) error {
return fmt.Errorf("cannot swap staging table: %w", err)
if err := coredata.SwapIPCountryBlocksStaging(ctx, tx); err != nil {
return fmt.Errorf("cannot swap staging table: %w", err)
}
return nil
},
); err != nil {
return err