Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VIPSLogic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VIPS
VIPSLogic
Commits
8f5a43a8
Commit
8f5a43a8
authored
6 days ago
by
Tor-Einar Skog
Browse files
Options
Downloads
Patches
Plain Diff
Add try-with-resources to model run client
parent
fdf0cb66
Branches
develop
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/no/nibio/vips/logic/controller/session/ForecastBean.java
+14
-13
14 additions, 13 deletions
.../no/nibio/vips/logic/controller/session/ForecastBean.java
with
14 additions
and
13 deletions
src/main/java/no/nibio/vips/logic/controller/session/ForecastBean.java
+
14
−
13
View file @
8f5a43a8
...
...
@@ -706,20 +706,21 @@ public class ForecastBean {
* catch(JsonProcessingException ex) { ex.printStackTrace(); }
*/
Response
resp
=
this
.
getManagerResource
(
modelInformation
).
runModel
(
config
.
getModelId
(),
request
);
if
(
resp
.
getStatus
()
==
Response
.
Status
.
OK
.
getStatusCode
())
{
// System.out.println(resp.readEntity(String.class));
List
<
Result
>
results
=
(
List
<
Result
>)
resp
.
readEntity
(
new
GenericType
<
List
<
Result
>>()
{});
// System.out.println("ForecastConfigId=" + forecastConfiguration.getForecastConfigurationId() + ",
// resultsize=" + results.size());
// We delete all former results before we store the new ones
forecastBean
.
storeResults
(
forecastConfiguration
,
results
);
}
else
{
throw
new
RunModelException
(
resp
.
readEntity
(
String
.
class
));
try
(
Response
resp
=
this
.
getManagerResource
(
modelInformation
).
runModel
(
config
.
getModelId
(),
request
))
{
if
(
resp
.
getStatus
()
==
Response
.
Status
.
OK
.
getStatusCode
())
{
// System.out.println(resp.readEntity(String.class));
List
<
Result
>
results
=
(
List
<
Result
>)
resp
.
readEntity
(
new
GenericType
<
List
<
Result
>>()
{});
// System.out.println("ForecastConfigId=" + forecastConfiguration.getForecastConfigurationId() + ",
// resultsize=" + results.size());
// We delete all former results before we store the new ones
forecastBean
.
storeResults
(
forecastConfiguration
,
results
);
}
else
{
throw
new
RunModelException
(
resp
.
readEntity
(
String
.
class
));
}
// System.out.println("Finished runModel for wsId" +
// forecastConfiguration.getWeatherStationPointOfInterestId());
}
// System.out.println("Finished runModel for wsId" +
// forecastConfiguration.getWeatherStationPointOfInterestId());
}
else
{
throw
new
PreprocessorException
(
"Could not find model with id=|"
+
forecastConfiguration
.
getModelId
()
+
"|"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment