V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
UnrealEngine
V2EX  ›  PHP

eval 执行 lua 报错 user_script:1: @user_script: 1: Lua redis() command arguments must be strings or integers

  •  
  •   UnrealEngine · 2022-05-11 22:09:18 +08:00 · 1455 次点击
    这是一个创建于 715 天前的主题,其中的信息可能已经有所发展或是发生改变。

    ERR Error running script (call to f_a08c9c69b7c07ae2485190873b90d128a23e502d): @user_script:1: @user_script: 1: Lua redis() command arguments must be strings or integers

    报错来源自

    Connection->command('eval', array('return redis.call('exists',KEYS[1])<1 and redis.call('setex',KEYS[1],ARGV[2],ARGV[1])', 1, 'cache:8e3a74c63406753fa072630e7112b312ffc42b99', 0, 60))

    已经懵了,问其他同事也不知道原因,只能找万能的 v 友了

    1 条回复    2022-05-12 09:19:09 +08:00
    willchen
        1
    willchen  
       2022-05-12 09:19:09 +08:00
    试一下 tonumber(ARGV[2])
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5456 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 71ms · UTC 07:52 · PVG 15:52 · LAX 00:52 · JFK 03:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.