Mercurial > gemma
comparison pkg/controllers/routes.go @ 4680:976aedc195e5
Be more clever when triggering diff calculations.
If a diff calc is started bring it to its end.
Before starting look if it is done and in db notice it as ready.
When a calculation is on its way add to list of waiting calls
to avoid starting a calculation again.
Only do two diff calcs at a time.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 15 Oct 2019 18:25:40 +0200 |
parents | 8f38a1bb9b79 |
children | b1428b44e43f |
comparison
equal
deleted
inserted
replaced
4679:6c1dd2fbe2ee | 4680:976aedc195e5 |
---|---|
183 | 183 |
184 // difference calculation | 184 // difference calculation |
185 api.Handle("/diff", any(&mw.JSONHandler{ | 185 api.Handle("/diff", any(&mw.JSONHandler{ |
186 Input: func(*http.Request) interface{} { return new(models.DiffCalculationInput) }, | 186 Input: func(*http.Request) interface{} { return new(models.DiffCalculationInput) }, |
187 Handle: diffCalculation, | 187 Handle: diffCalculation, |
188 NoConn: true, | |
188 })).Methods(http.MethodPost) | 189 })).Methods(http.MethodPost) |
189 | 190 |
190 // Cross sections | 191 // Cross sections |
191 api.Handle("/cross", any(&mw.JSONHandler{ | 192 api.Handle("/cross", any(&mw.JSONHandler{ |
192 Input: func(*http.Request) interface{} { return new(models.CrossSectionInput) }, | 193 Input: func(*http.Request) interface{} { return new(models.CrossSectionInput) }, |