I am working on a retail store application in which I have to display a error screen on the monitor of a Billing counter if some backend apis are not working. So there is background recursive application which keeps pinging another api for status, if status if unsatisfactory if continuously show error page in webview on monitor so that it can't be used by any person. Once application receives OK response from another api it needs to terminate that error page. So this process keeps going.
I am able to display the error page but once my error page is displayed my background application is not able to proceed further and do recursive check and check for api status again. Once the webview is displayed, My main thread is not going further thread.sleep and recursive call to checkForAPIStatus.
Spring Boot Main File:-
To make it easy as of now instead of api status I have taken a random status from array.
BringupBanner class is as follows:
Can anybody please point out what's wrong here or if there is a better way to achieve this ?