From d6830301f215e96328fa4f9a5ad9e253830386c3 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Mon, 1 Jan 2018 22:29:31 +0100 Subject: make: reloader: do not kill the process on reload failure --- src/blogc-make/reloader.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/blogc-make/reloader.c b/src/blogc-make/reloader.c index a4b837d..0edbee7 100644 --- a/src/blogc-make/reloader.c +++ b/src/blogc-make/reloader.c @@ -26,14 +26,16 @@ bm_reloader_thread(void *arg) bm_reloader_t *reloader = arg; while (reloader->running) { if (!bm_ctx_reload(reloader->ctx)) { - fprintf(stderr, "blogc-make: error: failed to reload context. " - "reloader disabled!\n"); - break; + fprintf(stderr, "blogc-make: warning: failed to reload context. " + "retrying in 5 seconds ...\n\n"); + sleep(5); + continue; } if (0 != reloader->rule_exec(reloader->ctx, reloader->outputs, reloader->args)) { - fprintf(stderr, "blogc-make: error: failed to rebuild website. " - "reloader disabled!\n"); - break; + fprintf(stderr, "blogc-make: warning: failed to rebuild website. " + "retrying in 5 seconds ...\n\n"); + sleep(5); + continue; } sleep(1); } -- cgit v1.2.3-18-g5258