X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=database.py;h=cc1732d86e01656f080705e5c579c57049e09b67;hb=dda654b474fe2962ac615924b4e078e5aae2ce49;hp=a49304f1ffe6414711fd39aeedfa5cb60d9c4710;hpb=0a4174b3ce1de8b33097e70c56cbe77ae0b1a5d1;p=nodemanager.git diff --git a/database.py b/database.py index a49304f..cc1732d 100644 --- a/database.py +++ b/database.py @@ -116,10 +116,10 @@ def start(): while True: db_lock.acquire() while not dump_requested: db_cond.wait() - db_copy = tools.deepcopy(db) + db_pickle = cPickle.dumps(db, cPickle.HIGHEST_PROTOCOL) dump_requested = False db_lock.release() - try: tools.write_file(DB_FILE, lambda f: cPickle.dump(db_copy, f, -1)) + try: tools.write_file(DB_FILE, lambda f: f.write(db_pickle)) except: logger.log_exc() global db try: