]> git.saurik.com Git - redis.git/commitdiff
use "EXPIREAT ... ms" form when rewriting the AOF
authorantirez <antirez@gmail.com>
Wed, 9 Nov 2011 16:20:14 +0000 (17:20 +0100)
committerantirez <antirez@gmail.com>
Wed, 9 Nov 2011 16:20:14 +0000 (17:20 +0100)
src/aof.c

index 9a35a367147db37e48933b981504b7a1fe8827e5..6706d5548a5a3bac02216fd570defaa9cccc06f9 100644 (file)
--- a/src/aof.c
+++ b/src/aof.c
@@ -608,12 +608,13 @@ int rewriteAppendOnlyFile(char *filename) {
             }
             /* Save the expire time */
             if (expiretime != -1) {
-                char cmd[]="*3\r\n$8\r\nEXPIREAT\r\n";
+                char cmd[]="*4\r\n$8\r\nEXPIREAT\r\n";
                 /* If this key is already expired skip it */
                 if (expiretime < now) continue;
                 if (rioWrite(&aof,cmd,sizeof(cmd)-1) == 0) goto werr;
                 if (rioWriteBulkObject(&aof,&key) == 0) goto werr;
-                if (rioWriteBulkLongLong(&aof,expiretime/1000) == 0) goto werr;
+                if (rioWriteBulkLongLong(&aof,expiretime) == 0) goto werr;
+                if (rioWriteBulkString(&aof,"ms",2) == 0) goto werr;
             }
         }
         dictReleaseIterator(di);