zhou zhou
4 天以前 7a215e51f9f4066f2024d8476e5b5db2c06358a1
rsf-server/src/main/resources/wms-lua/location-claim.lua
@@ -1,19 +1,8 @@
local mode = ARGV[1]
local occupyValue = ARGV[2]
local taskValue = ARGV[3]
local ttl = tonumber(ARGV[4])
local occupyValue = ARGV[1]
local ttl = tonumber(ARGV[2])
if mode == 'PUTAWAY' then
  if redis.call('exists', KEYS[1]) == 1 or redis.call('exists', KEYS[2]) == 1 then
if redis.call('exists', KEYS[1]) == 1 then
    return 0
  end
  redis.call('psetex', KEYS[1], ttl, occupyValue)
  redis.call('psetex', KEYS[2], ttl, taskValue)
  return 1
end
if redis.call('exists', KEYS[2]) == 1 then
  return 0
end
redis.call('psetex', KEYS[2], ttl, taskValue)
return 1