aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2022-08-28 21:24:44 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2022-08-28 21:24:44 +0200
commitee2f763bfbe6263bdfc6516887393e0327fa0f85 (patch)
tree1eaba51d91c3b29427d58d1309f486450ddb12a0
parentworker: fix a crash (diff)
downloadcimple-ee2f763bfbe6263bdfc6516887393e0327fa0f85.tar.gz
cimple-ee2f763bfbe6263bdfc6516887393e0327fa0f85.zip
server: notify workers about requeued jobs
This allows free workers to pick up jobs after dead workers.
Diffstat (limited to '')
-rw-r--r--src/server.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/server.c b/src/server.c
index f5318fa..e56ccd0 100644
--- a/src/server.c
+++ b/src/server.c
@@ -138,6 +138,14 @@ static int worker_requeue_run(struct server *server, struct ci_queue_entry *ci_r
ci_queue_push_head(&server->ci_queue, ci_run);
print_log("Requeued a CI run for repository %s\n", ci_run->url);
+ ret = pthread_cond_signal(&server->server_cv);
+ if (ret) {
+ pthread_print_errno(ret, "pthread_cond_signal");
+ ret = 0;
+ goto unlock;
+ }
+
+unlock:
pthread_check(pthread_mutex_unlock(&server->server_mtx), "pthread_mutex_unlock");
return ret;