Skip to content

Commit

Permalink
Merge pull request #228 from ThorodanBrom/bug-fix
Browse files Browse the repository at this point in the history
Bug-Fix : Increase wait time for router on start-up
  • Loading branch information
ThorodanBrom authored Dec 12, 2024
2 parents dfe3d4f + cf40d72 commit 7e75e1a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/ogc/rs/apiserver/ApiServerVerticle.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public class ApiServerVerticle extends AbstractVerticle {
String tileMatrixSetUrl = "https://raw.githubusercontent.com/opengeospatial/2D-Tile-Matrix-Set/master/registry" +
"/json/$.json";
JsonArray allCrsSupported = new JsonArray();
private static final int ROUTER_CREATION_WAIT_TIME_SEC = 60;

/**
* This method is used to start the Verticle. It deploys a verticle in a cluster/single instance, reads the
Expand Down Expand Up @@ -150,9 +151,10 @@ public void start() throws Exception {
* Start server only once router has at least one route (it will have only one, '/' since both
* the OGC and STAC sub-routers are bound to that path).
*
* Check every second for 20 seconds if router has been created. If it has, start server.
* Check every second for ROUTER_CREATION_WAIT_TIME_SEC seconds if router has been created. If
* it has, start server.
*/
AtomicInteger waitForRouterCounter = new AtomicInteger(20);
AtomicInteger waitForRouterCounter = new AtomicInteger(ROUTER_CREATION_WAIT_TIME_SEC);
vertx.setPeriodic(1000, wait -> {

if (!router.getRoutes().isEmpty()) {
Expand Down

0 comments on commit 7e75e1a

Please sign in to comment.