For instance this is how it looks like:Lua File:local _M = {}function _M.check_sql()local mysql = require "resty.mysql"local db, err = mysql:new()...endfunction _M.init_timers()if ( ngx.worker.id() ~= nil ) thenlocal ok, err = ngx.timer.at(10, _M.check_sql)endendreturn _MNginx Config:init_worker_by_lua 'whmcs = require "lua/ext_sql"whmcs.init_timers()';
Em quinta-feira, 25 de agosto de 2016 18:57:16 UTC-3, Fr3DBr escreveu:Hi, guys.I have a .lua file, which I an including towards my nginx.conf file. Although, when I try to use mysql from it, it hangs exactly here:local mysql = require "resty.mysql"I'm using openresty (latest version) and mysql is surely included there, but I'm not sure why using the resty.mysql extension inside a regular .lua file isn't working (even tho it is included through nginx config file).Any light ? :D--
You received this message because you are subscribed to the Google Groups "openresty-en" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openresty-en+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,When I said it hangs, I mean it hangs because I've added logging output to a simple txt file before each line of code, and it hangs as soon this line is going to be parsed:
local mysql = require "resty.mysql"
It doesn't moves further, since it hangs there. Get it now ?
So I wanted to know what could be missing to it work, or if I'm allowed to do this or not at all (in an external lua file, loaded by nginx.conf via require).
To unsubscribe from this group and stop receiving emails from it, send an email to openresty-en...@googlegroups.com.