UNPKG

layered-loader

Version:

Data loader with support for caching and fallback data sources

3 lines (2 loc) 523 B
export declare const GET_OR_SET_ZERO_WITH_TTL = "\nlocal key = KEYS[1]\nlocal ttl = ARGV[1]\n\nlocal current_value = redis.call('GET', key)\n\nif current_value == false then\n redis.call('SET', key, 0)\n redis.call('PEXPIRE', key, ttl)\n return 0\nend\n\nreturn current_value\n"; export declare const GET_OR_SET_ZERO_WITHOUT_TTL = "\nlocal key = KEYS[1]\n\nlocal current_value = redis.call('GET', key)\n\nif current_value == false then\n redis.call('SET', key, 0)\n return 0\nend\n\nreturn current_value\n";