summaryrefslogtreecommitdiff
path: root/src/db.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.c')
-rw-r--r--src/db.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/db.c b/src/db.c
index b7b4dc390..63705cd01 100644
--- a/src/db.c
+++ b/src/db.c
@@ -1612,14 +1612,14 @@ void propagateDeletion(redisDb *db, robj *key, int lazy) {
/* Check if the key is expired. */
int keyIsExpired(redisDb *db, robj *key) {
+ /* Don't expire anything while loading. It will be done later. */
+ if (server.loading) return 0;
+
mstime_t when = getExpire(db,key);
mstime_t now;
if (when < 0) return 0; /* No expire for this key */
- /* Don't expire anything while loading. It will be done later. */
- if (server.loading) return 0;
-
now = commandTimeSnapshot();
/* The key expired if the current (virtual or real) time is greater