doujiang24 / lua-resty-kafka

Lua kafka client driver for the Openresty based on the cosocket API
BSD 3-Clause "New" or "Revised" License
801 stars 274 forks source link

fix too many pending timers with timer.every #83

Closed wanghuizzz closed 4 years ago

wanghuizzz commented 4 years ago

1.use "_flush_pending_flag" to avoid creating timer.at when too many timers pending. 2.use timer.every to execute flushing and reset "_flush_pending_flag". 3.add test that trigger "too many pending timers"

doujiang24 commented 4 years ago

this commit log should be better: bugfix: avoiding too many pending timer errors by using ngx.timer.every.