yahoo / redislite

Redis in a python module.
Other
583 stars 74 forks source link

Memory only database (no disk persistance) #191

Closed hayj closed 6 months ago

hayj commented 6 months ago

I would like to create a RAM only database with no perstistance to be able to share a dict-like object across multiple processes.

Processes are independant (no main process on top), i.e. I basically execute 2 scripts which will open the same shared dict:

$python script_a.py
$python script_b.py

I tried this configuration but it still writes on disk. Any idea?

redislite.Redis("/tmp/db1", serverconfig={'save': '', 'appendonly': 'no'})

Maybe I could patch the code (notably this line from redis-py) to prevent the Redis class from periodically save?

hayj commented 6 months ago

I found the solution, we have to pass the quotes: serverconfig={'save': '""', 'appendonly': 'no'}