You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by 吴治国 <wz...@163.com> on 2022/04/02 06:08:53 UTC

Is there any way to trigger a timer when a plugin is enabled and cancel timer when plugin is disabled?

Hi community
  I met a problem when setting a timer in plugin, and I may need some help.
  I want to trigger a timer when plugin is enabled, but the init phase will execute whatever the plugin is enabled or not.
  And canceled the timer when plugin is disabled, But I haven't found any API to cancel a timer created by `ngx.timer.every()`
  Is there any way I can achieve my goal?

  Issue: https://github.com/apache/apisix/issues/6786 <https://github.com/apache/apisix/issues/6786>

Thanks.

Re: Is there any way to trigger a timer when a plugin is enabled and cancel timer when plugin is disabled?

Posted by ZhengSong Tu <tz...@gmail.com>.
APISIX is supported and the details have been replied to in the issue.


*ZhengSong Tu*
My GitHub: https://github.com/tzssangglass
Apache APISIX: https://github.com/apache/apisix


在 2022年4月2日 14:08:53 上,吴治国 <wz...@163.com> 写道:

> Hi community
>  I met a problem when setting a timer in plugin, and I may need some help.
>  I want to trigger a timer when plugin is enabled, but the init phase will
> execute whatever the plugin is enabled or not.
>  And canceled the timer when plugin is disabled, But I haven't found any
> API to cancel a timer created by `ngx.timer.every()`
>  Is there any way I can achieve my goal?
>
>  Issue: https://github.com/apache/apisix/issues/6786 <
> https://github.com/apache/apisix/issues/6786>
>
> Thanks.
>