diff --git a/migrations/kvalobs/import/cache/main.go b/migrations/kvalobs/import/cache/main.go index 65a90e6d..bc368006 100644 --- a/migrations/kvalobs/import/cache/main.go +++ b/migrations/kvalobs/import/cache/main.go @@ -21,6 +21,12 @@ type Cache struct { Permits lard.PermitMaps } +func New(kvalobs db.DB) *Cache { + permits := lard.NewPermitTables() + timespans := cacheKvalobsTimeseriesTimespans(kvalobs) + return &Cache{Permits: permits, Meta: timespans} +} + func (c *Cache) GetSeriesTimespan(label *db.Label) (utils.TimeSpan, error) { // First try to lookup timespan with both stationid and paramid // TODO: should these timespans modify an existing timeseries in lard? @@ -53,12 +59,6 @@ type MetaKey struct { Paramid sql.NullInt32 } -func New(kvalobs db.DB) *Cache { - permits := lard.NewPermitTables() - timespans := cacheKvalobsTimeseriesTimespans(kvalobs) - return &Cache{Permits: permits, Meta: timespans} -} - // Query kvalobs `station_metadata` table that stores timeseries timespans func cacheKvalobsTimeseriesTimespans(kvalobs db.DB) KvalobsTimespan { cache := make(KvalobsTimespan)