comparison pkg/imports/st.go @ 1911:6ffc372cde1e

Fixed JSON serialization of ISRS codes.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 18 Jan 2019 17:50:25 +0100
parents 32c56e6c089a
children a24d3b4b7ccd
comparison
equal deleted inserted replaced
1910:146369b1c376 1911:6ffc372cde1e
139 } 139 }
140 140
141 // CleanUp of a stretch import is a NOP. 141 // CleanUp of a stretch import is a NOP.
142 func (*Stretch) CleanUp() error { return nil } 142 func (*Stretch) CleanUp() error { return nil }
143 143
144 // Do executes the actual bottleneck import. 144 // Do executes the actual stretch import.
145 func (st *Stretch) Do( 145 func (st *Stretch) Do(
146 ctx context.Context, 146 ctx context.Context,
147 importID int64, 147 importID int64,
148 conn *sql.Conn, 148 conn *sql.Conn,
149 feedback Feedback, 149 feedback Feedback,
150 ) (interface{}, error) { 150 ) (interface{}, error) {
151 151
152 start := time.Now() 152 start := time.Now()
153
154 if st.Date.Time.IsZero() {
155 st.Date = models.Date{start}
156 }
153 157
154 feedback.Info("Storing stretch '%s'", st.Name) 158 feedback.Info("Storing stretch '%s'", st.Name)
155 159
156 if len(st.Countries) == 0 { 160 if len(st.Countries) == 0 {
157 return nil, errors.New("List of countries is empty") 161 return nil, errors.New("List of countries is empty")