niuoh
V2EX  ›  Lua

ngx_lua 遇到的一个小坑

  •  
  •   niuoh · Dec 9, 2016 · 9819 views
    This topic created in 3453 days ago, the information mentioned may be changed or developed.

    通过 nginx_lua 写了一些接口用来返回 json
    发现有时候接口访问失败 有一定几率 500
    lua 里有 mysql 操作 并且 content_by_lua_file a.lua
    这个 a.lua 开头有 dofile()
    dofile 的 lua 文件里申明了一些全局变量
    怎么解这个坑?

    2 replies    2020-04-23 10:37:14 +08:00
    ssdr
        1
    ssdr  
       Jan 31, 2019
    ngx_lua 从来就不建议你使用全局变量。
    MyIsland
        2
    MyIsland  
       Apr 23, 2020
    有木有杭州的 Lua 想换工作的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   859 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 20:20 · PVG 04:20 · LAX 13:20 · JFK 16:20
    ♥ Do have faith in what you're doing.