Why await is not taken in consideration after deploy?
- by Cristian Boariu
I have a method which does some sync calls to a specific REST api, something like:
WSRequestHolder url = WS.url("rest_api_url");
Promise<WS.Response> promisePerPage = url.get();
promisePerPage.getWrappedPromise().await(3000, TimeUnit.MILLISECONDS);
WS.Response responsePerPage = promisePerPage.get();
ProductsWrapper productsWrapper = new Gson().fromJson(responsePerPage.getBody(), ProductsWrapper.class);
As you notice, I put 3 seconds between calls so each request can be parsed in time and inserted in DB. All works great locally but after I deploy to cloud, all goes continuously, without any more waiting (3 seconds) between requests...
Do you know why?