chanjet1213 opened a new issue #5278:
URL: https://github.com/apache/apisix/issues/5278


   ### Issue description
   
   在配置文件中已经配置了插件,脚本也放到了plugins目录下 
   
   `# cat cron-test.lua
   local ngx = ngx
   local count = 1
   local delay = 1
   local handler
   local schema = {
       type = "object",
       properties = {
       },
       minProperties = 1,
       additionalProperties = false,
   }
   local plugin_name = "cron-test"
   local _M = {
       version = 0.1,
       priority = 3200,
       type = 'auth',
       name = plugin_name,
       schema = schema,
   }
   
   handler = function (premature)
       if premature then
           return
       end
       count  = count +1
       local ok, err = ngx.timer.at(delay, handler)
       if not ok then
           ngx.log(ngx.ERR, "failed to create the timer: ", err)
           return
       end
   end
   local ok, err = ngx.timer.at(delay, handler)
   if not ok then
       ngx.log(ngx.ERR, "failed to create the timer: ", err)
       return
   end
   function _M.access(conf, ctx)
       ngx.say(count)
   end
   return _M`
   
   ### Environment
   
   - apisix version (cmd: `apisix version`):2.10
   - OS (cmd: `uname -a`):
   - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`):
   - etcd version, if have (cmd: run `curl 
http://127.0.0.1:9090/v1/server_info` to get the info from server-info API):
   - apisix-dashboard version, if have:
   - the plugin runner version, if the issue is about a plugin runner (cmd: 
depended on the kind of runner):
   - luarocks version, if the issue is about installation (cmd: `luarocks 
--version`):
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to