diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2023-07-09 15:53:11 +0200 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2023-07-09 17:37:44 +0200 |
commit | 0600cacfadf00e916340f2394f1d3bfc173a3d0b (patch) | |
tree | 4b1900b096de3d2b3ad49094e86adc310ec79dac /src/worker.c | |
parent | test: attempt to fix random port selection again (diff) | |
download | cimple-0600cacfadf00e916340f2394f1d3bfc173a3d0b.tar.gz cimple-0600cacfadf00e916340f2394f1d3bfc173a3d0b.zip |
store process output in SQLite
Diffstat (limited to '')
-rw-r--r-- | src/worker.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/worker.c b/src/worker.c index b75ec4e..e45bfba 100644 --- a/src/worker.c +++ b/src/worker.c @@ -180,20 +180,22 @@ static int worker_do_run(struct worker *worker) { int ret = 0; - struct proc_output result; - proc_output_init(&result); + struct proc_output *result = NULL; + ret = proc_output_create(&result); + if (ret < 0) + return ret; - ret = ci_run_git_repo(run_get_url(worker->run), run_get_rev(worker->run), &result); + ret = ci_run_git_repo(run_get_url(worker->run), run_get_rev(worker->run), result); if (ret < 0) { log_err("Run failed with an error\n"); goto free_output; } - proc_output_dump(&result); + proc_output_dump(result); struct msg *finished_msg = NULL; - ret = msg_finished_create(&finished_msg, run_get_id(worker->run), &result); + ret = msg_finished_create(&finished_msg, run_get_id(worker->run), result); if (ret < 0) goto free_output; @@ -206,7 +208,7 @@ free_finished_msg: msg_free(finished_msg); free_output: - proc_output_free(&result); + proc_output_destroy(result); run_destroy(worker->run); |