Hello!
On Sat, Sep 17, 2016 at 02:42:25PM +0800, 洪志道 wrote:
> 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);
> }
Yes, as long as the code is in the timer
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 :
> Hello!
>
> On Sat, Sep 17, 2016 at 08:25:54AM +0800, 洪志道
Hello!
On Sat, Sep 17, 2016 at 08:25:54AM +0800, 洪志道 wrote:
[...]
> static void
> ngx_http_log_flush(ngx_open_file_t *file, ngx_log_t *log)
> {
> ...
> if (buffer->event && buffer->event->timer_set) {
> ngx_del_timer(buffer->event);
> }
> }
>
>
> I find there are two
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