Mercurial > gemma
annotate pkg/imports/erdms.go @ 5612:a9bcaac49a7e erdms2
Beware of nil interfaces.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 07 Nov 2022 21:03:32 +0100 |
parents | a826d84485c8 |
children | 57c655b93ba8 |
rev | line source |
---|---|
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
1 // This is Free Software under GNU Affero General Public License v >= 3.0 |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
2 // without warranty, see README.md and license for details. |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
3 // |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
4 // SPDX-License-Identifier: AGPL-3.0-or-later |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
5 // License-Filename: LICENSES/AGPL-3.0.txt |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
6 // |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
7 // Copyright (C) 2018, 2019 by via donau |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
8 // – Österreichische Wasserstraßen-Gesellschaft mbH |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
9 // Software engineering by Intevation GmbH |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
10 // |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
11 // Author(s): |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
12 // * Sascha L. Teichmann <sascha.teichmann@intevation.de> |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
13 // * Tom Gottfried <tom.gottfried@intevation.de> |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
14 |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
15 package imports |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
16 |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
17 import ( |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
18 "context" |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
19 "database/sql" |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
20 "fmt" |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
21 "strings" |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
22 |
5610
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5609
diff
changeset
|
23 "gemma.intevation.de/gemma/pkg/config" |
5490
5f47eeea988d
Use own logging package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3551
diff
changeset
|
24 "gemma.intevation.de/gemma/pkg/log" |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
25 "gemma.intevation.de/gemma/pkg/soap" |
5609
e1936db6db8e
Adjust ta erdms data structure.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5490
diff
changeset
|
26 erdms "gemma.intevation.de/gemma/pkg/soap/erdms2" |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
27 ) |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
28 |
2988
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
29 const ( |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
30 selectUserCountriesSQL = ` |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
31 SELECT DISTINCT country FROM users.list_users |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
32 WHERE country <> '--' |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
33 ` |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
34 ) |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
35 |
3163
d9903cb34842
Handle failing INSERTs gracefully during gauges import
Tom Gottfried <tom@intevation.de>
parents:
3161
diff
changeset
|
36 func userCountries(ctx context.Context, conn *sql.Conn) ([]string, error) { |
d9903cb34842
Handle failing INSERTs gracefully during gauges import
Tom Gottfried <tom@intevation.de>
parents:
3161
diff
changeset
|
37 rows, err := conn.QueryContext(ctx, selectUserCountriesSQL) |
2988
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
38 if err != nil { |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
39 return nil, err |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
40 } |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
41 defer rows.Close() |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
42 |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
43 var countries []string |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
44 |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
45 for rows.Next() { |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
46 var country string |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
47 if err = rows.Scan(&country); err != nil { |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
48 return nil, err |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
49 } |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
50 countries = append(countries, country) |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
51 } |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
52 |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
53 if err := rows.Err(); err != nil { |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
54 return nil, err |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
55 } |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
56 |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
57 return countries, nil |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
58 } |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
59 |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
60 func getRisData( |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
61 ctx context.Context, |
3163
d9903cb34842
Handle failing INSERTs gracefully during gauges import
Tom Gottfried <tom@intevation.de>
parents:
3161
diff
changeset
|
62 conn *sql.Conn, |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
63 feedback Feedback, |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
64 username string, |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
65 password string, |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
66 URL string, |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
67 insecure bool, |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
68 funcode string, |
3551
a5448426e4e2
Only erase gauges that have been requested from ERDMS
Tom Gottfried <tom@intevation.de>
parents:
3163
diff
changeset
|
69 ) ([]*erdms.GetRisDataXMLResponse, []string, error) { |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
70 |
3163
d9903cb34842
Handle failing INSERTs gracefully during gauges import
Tom Gottfried <tom@intevation.de>
parents:
3161
diff
changeset
|
71 countries, err := userCountries(ctx, conn) |
2988
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
72 if err != nil { |
3551
a5448426e4e2
Only erase gauges that have been requested from ERDMS
Tom Gottfried <tom@intevation.de>
parents:
3163
diff
changeset
|
73 return nil, nil, err |
2988
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
74 } |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
75 |
5610
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5609
diff
changeset
|
76 var auth soap.Auth |
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5609
diff
changeset
|
77 |
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5609
diff
changeset
|
78 if tokenURL := config.TokenURL(); tokenURL != "" && username != "" { |
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5609
diff
changeset
|
79 token, err := soap.FetchToken(tokenURL, username, password) |
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5609
diff
changeset
|
80 if err != nil { |
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5609
diff
changeset
|
81 return nil, nil, fmt.Errorf( |
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5609
diff
changeset
|
82 "error requesting token for ERDMS service: %w", err) |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
83 } |
5610
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5609
diff
changeset
|
84 auth = token |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
85 } |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
86 |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
87 client := erdms.NewRefService(URL, insecure, auth) |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
88 |
2988
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
89 var responseData []*erdms.GetRisDataXMLResponse |
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
90 for _, country := range countries { |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
91 |
2988
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
92 feedback.Info("Request RIS index for country %s", country) |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
93 |
5609
e1936db6db8e
Adjust ta erdms data structure.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5490
diff
changeset
|
94 subcode := erdms.RisCodeType(country + "%") |
e1936db6db8e
Adjust ta erdms data structure.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5490
diff
changeset
|
95 |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
96 request := &erdms.GetRisDataXML{ |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
97 GetRisDataXMLType: &erdms.GetRisDataXMLType{ |
5609
e1936db6db8e
Adjust ta erdms data structure.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5490
diff
changeset
|
98 Subcode: &subcode, |
e1936db6db8e
Adjust ta erdms data structure.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5490
diff
changeset
|
99 Funcode: funcode, |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
100 }, |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
101 } |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
102 |
3161
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2988
diff
changeset
|
103 const maxTries = 3 |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2988
diff
changeset
|
104 |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2988
diff
changeset
|
105 tries := 0 |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2988
diff
changeset
|
106 |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2988
diff
changeset
|
107 again: |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
108 data, err := client.GetRisDataXML(request) |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
109 if err != nil { |
3161
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2988
diff
changeset
|
110 if t, ok := err.(interface{ Timeout() bool }); ok && t.Timeout() && tries < maxTries { |
5490
5f47eeea988d
Use own logging package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3551
diff
changeset
|
111 log.Warnln("warn: ERDMS SOAP request timed out. Trying again.") |
3161
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2988
diff
changeset
|
112 tries++ |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2988
diff
changeset
|
113 goto again |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2988
diff
changeset
|
114 } |
3551
a5448426e4e2
Only erase gauges that have been requested from ERDMS
Tom Gottfried <tom@intevation.de>
parents:
3163
diff
changeset
|
115 return nil, nil, fmt.Errorf( |
a5448426e4e2
Only erase gauges that have been requested from ERDMS
Tom Gottfried <tom@intevation.de>
parents:
3163
diff
changeset
|
116 "Error requesting ERDMS service: %v", err) |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
117 } |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
118 responseData = append(responseData, data) |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
119 } |
2988
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
120 |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
121 feedback.Info("Import data for countries: %s.", |
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
122 strings.Join(countries, ", ")) |
2988
e1ccc8438529
DMV: separated fetching list of countries from database from requesting the RIS index. Also added some logging and better error handling.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
2633
diff
changeset
|
123 |
3551
a5448426e4e2
Only erase gauges that have been requested from ERDMS
Tom Gottfried <tom@intevation.de>
parents:
3163
diff
changeset
|
124 return responseData, countries, nil |
2633
eb1d119f253f
Fetch data from ERDMS for all allowed countries
Tom Gottfried <tom@intevation.de>
parents:
diff
changeset
|
125 } |