Example #1
0
static int without_jobs()
{
    check_lua_sleep_timeouts();
    check_timeouts();

    if ( checkProcessForExit() || has_error_for_exit ) {
        //network_send_error ( epd, 500, "Child Process restart!" );
        //close_client ( epd );
    }

    sync_serv_status();

    do_other_jobs();
}
Example #2
0
static int other_simple_jobs()
{
    coevnet_module_do_other_jobs();
    sync_serv_status();
#ifdef SMPDEBUG

    if(now - dump_smp_link_time > 60) {
        dump_smp_link_time = now;
        dump_smp_link();
    }

#endif

    if(++flush_logs_timer > 100) {
        flush_logs_timer = 0;
        sync_logs(LOGF_T);
        sync_logs(ACCESS_LOG);
    }

    return 1; // return 0 will be exit the worker
}
Example #3
0
static void on_exit_handler()
{
    if(exited) {
        return;
    }

    now += 10;
    serv_status.waiting_counts = 0;
    serv_status.reading_counts = 0;
    serv_status.sending_counts = 0;
    serv_status.active_counts = 0;
    sync_serv_status();

    exited = 1;
    sync_logs(ACCESS_LOG);
    LOGF(ALERT, "worker %d exited", worker_n);

    if(getarg("gcore") && !check_process_for_exit()) {
        char cmd[50] = {0};
        sprintf(cmd, "gcore -o dump %u", getpid());
        system(cmd);
    }
}