X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/2c6cc5e502824f1b4e222ebfa1a3fc89f078ae32..b0d1d2684d15aeb201da6f8e1e23ba496d6907ad:/src/rdb.c diff --git a/src/rdb.c b/src/rdb.c index a2471aef..d019d94f 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -430,7 +430,7 @@ int rdbSave(char *filename) { redisDb *db = server.db+j; dict *d = db->dict; if (dictSize(d) == 0) continue; - di = dictGetIterator(d); + di = dictGetSafeIterator(d); if (!di) { fclose(fp); return REDIS_ERR; @@ -918,7 +918,7 @@ void stopLoading(void) { int rdbLoad(char *filename) { FILE *fp; uint32_t dbid; - int type, retval, rdbver; + int type, rdbver; redisDb *db = server.db+0; char buf[1024]; time_t expiretime, now = time(NULL); @@ -981,11 +981,8 @@ int rdbLoad(char *filename) { continue; } /* Add the new object in the hash table */ - retval = dbAdd(db,key,val); - if (retval == REDIS_ERR) { - redisLog(REDIS_WARNING,"Loading DB, duplicated key (%s) found! Unrecoverable error, exiting now.", key->ptr); - exit(1); - } + dbAdd(db,key,val); + /* Set the expire time if needed */ if (expiretime != -1) setExpire(db,key,expiretime);