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?
You can use ngx.timer
https://github.com/openresty/...
You can use tcp in ngx.timer