How to reduce sleep timings on jenkins pipelines

How to reduce sleep timings on Jenkins pipelines
is there any examples for source code
Note : what is if i remove the sleep time in the source code what kind of line i need to add over there

Can you please advise.

You’ve asked a question without providing enough context for others to understand your question. It is expected that you will provide enough context in your question so that others can offer ideas based on your context.

while (true) {
// Retrieve build status
build_status = sh(script: “oc get builds ${build_name} -o jsonpath={.status.phase}”, returnStdout: true)
if (build_status in [“New”, “Pending”, “Running”]) {
sh “sleep 60”
} else if (build_status == “Complete”) {
sh “oc logs build/${build_name}”
} else if (build_status in [“Failed”, “Error”, “Cancelled”]) {
sh “oc logs build/${build_name}”
sh “exit 1”

Build time is taking more then 1 minit in loop to create docker image

The Pipeline sleep command and sleep 13 will pause execution for 13 seconds

If you want to wait for an Openshift build you have triggered to complete you can use the --wait=true option when triggering it. The command will complete only when the build terminates, no need to sleep in this case.