diff --git a/migrations/kvalobs/import/cache/main.go b/migrations/kvalobs/import/cache/main.go index f1b7e5f6..65a90e6d 100644 --- a/migrations/kvalobs/import/cache/main.go +++ b/migrations/kvalobs/import/cache/main.go @@ -3,7 +3,6 @@ package cache import ( "context" "database/sql" - "errors" "log/slog" "os" "time" @@ -36,8 +35,10 @@ func (c *Cache) GetSeriesTimespan(label *db.Label) (utils.TimeSpan, error) { return timespan, nil } - // If there is no timespan we can't insert a new timeseries - return utils.TimeSpan{}, errors.New(label.LogStr() + "No timespan found, cannot create timeseries") + // If there is no timespan we insert null fromtime and totime + // TODO: is this really what we want to do? + // Is there another place where to find this information? + return utils.TimeSpan{}, nil } func (c *Cache) TimeseriesIsOpen(stnr, typeid, paramid int32) bool { diff --git a/migrations/lard/timeseries.go b/migrations/lard/timeseries.go index 13690f16..185cc51d 100644 --- a/migrations/lard/timeseries.go +++ b/migrations/lard/timeseries.go @@ -2,7 +2,6 @@ package lard import ( "context" - "errors" "migrate/utils" "github.com/jackc/pgx/v5/pgxpool" @@ -62,10 +61,6 @@ func GetTimeseriesID(label *Label, timespan utils.TimeSpan, pool *pgxpool.Pool) } } - if timespan.From == nil { - return tsid, errors.New("Fromtime should never be null when creating new timeseries") - } - // If none of the above worked insert a new timeseries transaction, err := pool.Begin(context.TODO()) if err != nil {