Skip to content
On this page

Directus Cloud

Everything you need to start building. Provisioned in 90 seconds. Starting at $15/month.

Get Started

This is an auto-generated document to support extension builders understand the internal packages they can utilize. To find our written guides, tutorials, and API/SDK reference, check out our main docs .

Directus / @directus/memory / index / SET_MAX_SCRIPT

Variable: SET_MAX_SCRIPT ​

const SET_MAX_SCRIPT: "\n local key = KEYS[1]\n local value = tonumber(ARGV[1])\n\n if redis.call("EXISTS", key) == 1 then\n local oldValue = tonumber(redis.call('GET', key))\n\n if value <= oldValue then\n return false\n end\n end\n\n redis.call('SET', key, value)\n\n return true\n"

Defined in ​

packages/memory/src/kv/lib/redis.ts:14