nginx - How to query mysql regularly in openresty's init_worker
曾经蜡笔没有小新
曾经蜡笔没有小新 2017-05-16 17:11:11
0
2
487

I want to set up a timer in init_worker to query mysql information. I found that tcp connection cannot be used in init_worker, so how can I get mysql data in init_worker. I found a post on the Internet that said to call the shell command to obtain it. Is that the only way?

曾经蜡笔没有小新
曾经蜡笔没有小新

reply all(2)
Ty80

You can use ngx.timer
https://github.com/openresty/...

巴扎黑

You can use tcp in ngx.timer

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!