From ee2f763bfbe6263bdfc6516887393e0327fa0f85 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 28 Aug 2022 21:24:44 +0200 Subject: server: notify workers about requeued jobs This allows free workers to pick up jobs after dead workers. --- src/server.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/server.c') 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; -- cgit v1.2.3