FILE *fp;
char tmpfile[256];
int j;
- time_t now = time(NULL);
+ long long now = mstime();
/* Note that we have to use a different temp name here compared to the
* one used by rewriteAppendOnlyFileBackground() function. */
while((de = dictNext(di)) != NULL) {
sds keystr;
robj key, *o;
- time_t expiretime;
+ long long expiretime;
keystr = dictGetKey(de);
o = dictGetVal(de);
while((de = dictNext(di)) != NULL) {
sds key;
robj *keyobj, *o;
- time_t expiretime;
+ long long expiretime;
memset(digest,0,20); /* This key-val digest */
key = dictGetKey(de);
* of the keys were expired. */
do {
long num = dictSize(db->expires);
- time_t now = time(NULL);
+ long long now = mstime();
expired = 0;
if (num > REDIS_EXPIRELOOKUPS_PER_CRON)
num = REDIS_EXPIRELOOKUPS_PER_CRON;
while (num--) {
dictEntry *de;
- time_t t;
+ long long t;
if ((de = dictGetRandomKey(db->expires)) == NULL) break;
- t = (time_t) dictGetVal(de);
+ t = dictGetSignedIntegerVal(de);
if (now > t) {
sds key = dictGetKey(de);
robj *keyobj = createStringObject(key,sdslen(key));