- /* Update the access time of the key for the aging algorithm. */
- if (server.vm_enabled) o->vm.atime = server.unixtime;
- return o;
+ if (server.vm_enabled) {
+ if (key->storage == REDIS_VM_MEMORY) {
+ /* Update the access time of the key for the aging algorithm. */
+ key->vm.atime = server.unixtime;
+ } else {
+ /* Our value was swapped on disk. Bring it at home. */
+ assert(val == NULL);
+ val = vmLoadObject(key);
+ dictGetEntryVal(de) = val;
+ }
+ }
+ return val;