0

I have a rest API (Python based). The underlying logic calls an Oracle procedure that refreshes certain materialized views. The application is hosted on Openshift Container Platform. Now sometimes the app gets stuck on this step( refresh materialized views). Is there a way to add a liveness probe here that restarts the container if the app remains stuck at this step for some amount of time say 2 hours.

Ketan_Gupta
  • 81
  • 1
  • 9

1 Answers1

0

Is there a way to add a liveness probe here that restarts the container if the app remains stuck at this step for some amount of time say 2 hours.

Yes, that would be possible, however you would need to implement the logic yourself.

Liveness probes typically check the return code of a command or the HTTP response from a REST endpoint. So in your case you would likely need to create a new REST endpoint that checks and will return an error if any step is taking longer than a certain time. If that is the case, the endpoint should return a HTTP error code such as 500.

Simon
  • 4,251
  • 2
  • 24
  • 34