当前位置:网站首页>PHP returns false when calling redis method decrby less than 0
PHP returns false when calling redis method decrby less than 0
2022-06-26 12:25:00 【Yotoai Mengtian】
public function decr($key, $val = 1, $lessZero = false)
{
if ($lessZero) {
$luaScript = <<<LUA
if tonumber(redis.call("get", KEYS[1])) > 0 then
return redis.call('decrBy', KEYS[1], ARGV[1])
else
return false
end
LUA;
//
$res = $this->redis->eval($luaScript, [$key, $val], 1);
} else {
//
$res = $this->redis->decrBy($key, $val);
}
//
return $res;
}边栏推荐
- HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 2 MPU based IOT device attack mitigation technology
- 十大券商有哪些?手机开户安全么?
- Investment forecast and development strategy analysis report of China's rural sewage treatment industry in 2022
- The loss of female scientists
- How to do well in member marketing three steps to teach you to understand member management
- The transformation of enterprise customers' digital assets needs to suit the case
- 女性科学家的流失
- 利用 Repository 中的方法解决实际问题
- Pratique de l'attaque et de la défense du réseau HUST | 6 Expérience de sécurité du microprogramme de l'équipement IOT | expérience 2 technologie d'atténuation des attaques de l'équipement IOT basée s
- CG bone animation
猜你喜欢

【Redis 系列】redis 学习十六,redis 字典(map) 及其核心编码结构

【毕业季·进击的技术er】忆毕业一年有感

Re recognized! Know that Chuangyu has been selected as one of the first member units of the "business security promotion plan"

Black squares in word

Jmeter响应时间和tps监听器使用教程

Using the methods in the repository to solve practical problems

This executeQuery (SQL) cannot compile classes for JSP. What is the reason?

Scala-day02- variables and data types

PHP laravel+gatewayworker completes im instant messaging and file transfer (Chapter 1: basic configuration)

Loggie encoding and newline character test
随机推荐
我想知道,股票开户有哪些优惠活动?网上开户是否安全么?
Scala problem solving the problem of slow SBT Download
Jsonarray and jsonobject of fastjson [easy to understand]
Comparison of latest mobile phone processors in 2020 (with mobile phone CPU ladder diagram)
HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 3 freertos-mpu protection bypass
MOS管基本原理,单片机重要知识点
China Medical Grade hydrogel market supply and demand research and prospect analysis report 2022 Edition
Is it safe to open a securities account in general
Redis cannot connect to the server through port 6379
PHP uses laravel pay component to quickly access wechat jsapi payment (wechat official account payment)
One click deployment of your own community forum
Rookie practical UML - activity diagram
Spark-day02-core programming-rdd
Laravel uses find_ IN_ The set() native MySQL statement accurately queries whether a special string exists in the specified string to solve the problem that like cannot be accurately matched. (resolve
Current situation investigation and investment prospect forecast analysis report of China's electrolytic copper market from 2022 to 2028
【Redis 系列】redis 学习十六,redis 字典(map) 及其核心编码结构
The loss of female scientists
The transformation of enterprise customers' digital assets needs to suit the case
Analysis report on dynamic research and investment planning suggestions of China's laser medical market in 2022
Introduction to the four major FPGA manufacturers abroad