Skip to content

Instantly share code, notes, and snippets.

@mchmielarz
Last active December 17, 2018 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mchmielarz/56e203ba076ce71312231ba561206da9 to your computer and use it in GitHub Desktop.
Save mchmielarz/56e203ba076ce71312231ba561206da9 to your computer and use it in GitHub Desktop.
Start database and fetch measurements with Try
Try
.run(database::start)
.onSuccess(ignore -> log.info("Database started successfully"))
  .onFailure(exc -> log.error("Cannot start the database", exc))
  .andThen(
() -> fetchMeasurements(geoCoordinatesReader, airlyService, measurementsRepository)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment