Thank you for your reply, I get it now. In other case such as I showed above, it seems we needn't do like the following ? if (ev->timer_set) { ngx_del_timer(ev); } 2016-09-17 10:48 GMT+08:00 Maxim Dounin <mdounin@mdounin.ru>: > Hello! > > On Sat, Sep 17, 2016 at 08:25:54AM +0800, 洪志道 wrote: > > [...] > > > static void > > ngx_http_log_flush(nby karton - Nginx Development
Well, I get it. By the way, If I want to add a timer, it can do something like crontab in worker process. For example, we collect data in worker process and dump the data every 5 minutes. event->cancelable = 1; In event handler, the codes like the following: static void ngx_http_test_timer_handler(ngx_event_t *ev) { if (event->timedout) { /* todo timedout */ returby karton - Nginx Development
Hi As the following codes. buffer->event->handler = ngx_http_log_flush_handler; static void ngx_http_log_flush_handler(ngx_event_t *ev) { ... if (ev->timedout) { ngx_http_log_flush(ev->data, ev->log); return; } ... } static void ngx_http_log_flush(ngx_open_file_t *file, ngx_log_t *log) { ... if (buffer->event && buffer->evby karton - Nginx Development