Hello,

i've just found that workers executing cron jobs respects the harakiri parameter. Looking at the code for a way to workaround that I was wondering if cron-harakiri shouldn't have precedence over the generic harakiri as patch below.
Also would using -1 a cron-harakiri (after the patch) let the workers runs 
forever?

--- a/core/cron.c
+++ b/core/cron.c
@@ -172,7 +172,10 @@ void uwsgi_opt_add_cron2(char *opt, char *value, void *foobar) {
        if (c_unique)
                uc->unique = atoi(c_unique);

-       if (c_harakiri) {
+       if (uwsgi.cron_harakiri) {
+               uc->harakiri = uwsgi.cron_harakiri;
+       }
+       else if (c_harakiri) {
                if (atoi(c_harakiri)) {
                        // harakiri > 0
                        uc->mercy = atoi(c_harakiri);
@@ -182,9 +185,6 @@ void uwsgi_opt_add_cron2(char *opt, char *value, void 
*foobar) {
                        uc->mercy = -1;
                }
        }
-       else if (uwsgi.cron_harakiri) {
-               uc->harakiri = uwsgi.cron_harakiri;
-       }
 }


thanks

--
Riccardo Magliocchetti
@rmistaken

http://menodizero.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to