Skip to content
Snippets Groups Projects
Commit dbe26d53 authored by Luca Mertens's avatar Luca Mertens :croissant:
Browse files

Only update `ExecutionStatus` every second, instead of every 100ms.

parent 7af98977
No related branches found
No related tags found
1 merge request!301Only update `ExecutionStatus` every second, instead of every 100ms.
......@@ -4,7 +4,7 @@ import io.fabric8.kubernetes.api.model.MicroTime
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import rocks.theodolite.kubernetes.model.crd.ExecutionCRD
import rocks.theodolite.kubernetes.model.crd.ExecutionState
import java.lang.Thread.sleep
import java.util.concurrent.TimeUnit.SECONDS
import java.time.Instant
import java.util.concurrent.atomic.AtomicBoolean
......@@ -41,7 +41,7 @@ class ExecutionStateHandler(val client: NamespacedKubernetesClient) :
Thread {
while (this.runExecutionDurationTimer.get()) {
updateDurationState(resourceName)
sleep(100 * 1)
SECONDS.sleep(1)
}
}.start()
}
......@@ -50,6 +50,6 @@ class ExecutionStateHandler(val client: NamespacedKubernetesClient) :
fun stopDurationStateTimer(resourceName: String) {
super.setState(resourceName) { cr -> cr.status.completionTime = MicroTime(Instant.now().toString()); cr }
this.runExecutionDurationTimer.set(false)
sleep(100 * 2)
SECONDS.sleep(2)
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment