summaryrefslogtreecommitdiff
path: root/src/db.c
diff options
context:
space:
mode:
authorBinbin <binloveplay1314@qq.com>2022-01-12 04:43:18 +0800
committerGitHub <noreply@github.com>2022-01-11 22:43:18 +0200
commite22146b07a8b5adc37e0153def1783406eb6d27c (patch)
tree2e5fbac3acb663ed4931575d58aeecc4d3045de3 /src/db.c
parent6790d848c5cf76ad5833d155fc4debc50b9ef2c4 (diff)
downloadredis-e22146b07a8b5adc37e0153def1783406eb6d27c.tar.gz
Add script tests to cover keys with expiration time set (#10096)
This commit adds some tests that the test cases will access the keys with expiration time set in the script call. There was no test case for this part before. See #10080 Also there is a test will cover #1525. we block the time so that the key can not expire in the middle of the script execution. Other changes: 1. Delete `evalTimeSnapshot` and just use `scriptTimeSnapshot` in it's place. 2. Some cleanups to scripting.tcl. 3. better names for tests that run in a loop to make them distinctable
Diffstat (limited to 'src/db.c')
-rw-r--r--src/db.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/db.c b/src/db.c
index 0d19b00dd..cd824024d 100644
--- a/src/db.c
+++ b/src/db.c
@@ -1559,7 +1559,7 @@ int keyIsExpired(redisDb *db, robj *key) {
* script execution, making propagation to slaves / AOF consistent.
* See issue #1525 on Github for more information. */
if (server.script_caller) {
- now = evalTimeSnapshot();
+ now = scriptTimeSnapshot();
}
/* If we are in the middle of a command execution, we still want to use
* a reference time that does not change: in that case we just use the