From dcafe41cded3c13af8f3cf0df946bf90a40cba33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Thu, 11 Apr 2013 14:09:49 +0200 Subject: [PATCH 1/2] execute cron tasks with 60 second resolution, instead of 61 seconds --- core/master_utils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/master_utils.c b/core/master_utils.c index 33de0b65..28909312 100644 --- a/core/master_utils.c +++ b/core/master_utils.c @@ -652,7 +652,7 @@ void uwsgi_manage_signal_cron(time_t now) { if (run_task == 1) { // date match, signal it ? - if (now - ucron->last_job > 60) { + if (now - ucron->last_job >= 60) { uwsgi_route_signal(ucron->sig); ucron->last_job = now; } @@ -701,7 +701,7 @@ void uwsgi_manage_command_cron(time_t now) { if (run_task == 1) { // date match, run command ? - if (now - current_cron->last_job > 60) { + if (now - current_cron->last_job >= 60) { //call command if (current_cron->command) { if (uwsgi_run_command(current_cron->command, NULL, -1) >= 0) { From 22569e64dfdc41c86f47d91c662ee319e1e79bc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Mierzwa?= Date: Thu, 11 Apr 2013 14:33:38 +0200 Subject: [PATCH 2/2] remove unnecessary new lines in legion logs --- core/legion.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/legion.c b/core/legion.c index d705aac4..cc5facb2 100644 --- a/core/legion.c +++ b/core/legion.c @@ -232,12 +232,12 @@ struct uwsgi_legion_node *uwsgi_legion_get_lord(struct uwsgi_legion *); static void legions_report_quorum(struct uwsgi_legion *ul, uint64_t best_valor, char *best_uuid, int votes) { struct uwsgi_legion_node *nodes = ul->nodes_head; - uwsgi_log("\n[uwsgi-legion] --- WE HAVE QUORUM FOR LEGION %s !!! (valor: %llu uuid: %.*s checksum: %llu votes: %d) ---\n", ul->legion, best_valor, 36, best_uuid, ul->checksum, votes); + uwsgi_log("[uwsgi-legion] --- WE HAVE QUORUM FOR LEGION %s !!! (valor: %llu uuid: %.*s checksum: %llu votes: %d) ---\n", ul->legion, best_valor, 36, best_uuid, ul->checksum, votes); while (nodes) { uwsgi_log("[uwsgi-legion-node] node: %.*s valor: %llu uuid: %.*s last_seen: %d vote_valor: %llu vote_uuid: %.*s\n", nodes->name_len, nodes->name, nodes->valor, 36, nodes->uuid, nodes->last_seen, nodes->lord_valor, 36, nodes->lord_uuid); nodes = nodes->next; } - uwsgi_log("[uwsgi-legion] --- END OF QUORUM REPORT ---\n\n"); + uwsgi_log("[uwsgi-legion] --- END OF QUORUM REPORT ---\n"); } uint64_t uwsgi_legion_checksum(struct uwsgi_legion *ul) { @@ -357,9 +357,9 @@ static void legions_check_nodes_step2() { if (ul->i_am_the_lord) { uwsgi_log("[uwsgi-legion] a new Lord (valor: %llu uuid: %.*s) raised for Legion %s...\n", ul->lord_valor, 36, ul->lord_uuid, ul->legion); if (ul->lord_scroll_len > 0) { - uwsgi_log("*********** The New Lord Scroll ***********\n\n"); + uwsgi_log("*********** The New Lord Scroll ***********\n"); uwsgi_log("%.*s\n", ul->lord_scroll_len, ul->lord_scroll); - uwsgi_log("\n*********** End of the New Lord Scroll ***********\n\n"); + uwsgi_log("*********** End of the New Lord Scroll ***********\n"); } // no more lord, trigger unlord hooks struct uwsgi_string_list *usl = ul->unlord_hooks;