Mercurial > gemma
changeset 1756:295c82c5bc3e
Fairway availability import: Cosmetics.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 10 Jan 2019 16:56:39 +0100 |
parents | d3fe20a13339 |
children | 0e2c35f95c85 |
files | pkg/imports/fa.go |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/pkg/imports/fa.go Thu Jan 10 16:43:42 2019 +0100 +++ b/pkg/imports/fa.go Thu Jan 10 16:56:39 2019 +0100 @@ -242,9 +242,8 @@ return nil, err } - latestMeasureDateRow := conn.QueryRowContext(ctx, latestMeasureDateSQL) var latestDate pgtype.Timestamp - err = latestMeasureDateRow.Scan(&latestDate) + err = conn.QueryRowContext(ctx, latestMeasureDateSQL).Scan(&latestDate) switch { case err == sql.ErrNoRows: latestDate = pgtype.Timestamp{ @@ -349,7 +348,8 @@ BottleneckId: faRes.Bottleneck_id, Surdat: faRes.SURDAT, } - if _, ok := fairwayAvailabilities[uniqueFa]; !ok { + var found bool + if faID, found = fairwayAvailabilities[uniqueFa]; !found { err = insertFAStmt.QueryRowContext( ctx, faRes.POSITION, @@ -363,8 +363,6 @@ return nil, err } fairwayAvailabilities[uniqueFa] = faID - } else { - faID, _ = fairwayAvailabilities[uniqueFa] } feedback.Info("Processing for Bottleneck %s", faRes.Bottleneck_id) faIDs = append(faIDs, faRes.Bottleneck_id)