chg: programmatically shutdown DBs

pull/295/head
Raphaël Vinot 2021-11-26 12:35:15 -05:00
parent a5a3a00938
commit cef1088984
3 changed files with 8 additions and 14 deletions

View File

@ -35,7 +35,10 @@ def launch_cache(storage_directory: Optional[Path]=None):
def shutdown_cache(storage_directory: Optional[Path]=None):
if not storage_directory:
storage_directory = get_homedir()
Popen(["./shutdown_redis.sh"], cwd=(storage_directory / 'cache'))
r = Redis(unix_socket_path=get_socket_path('cache'))
r.save()
r.shutdown()
print('Redis cache database shutdown.')
def launch_indexing(storage_directory: Optional[Path]=None):
@ -48,7 +51,10 @@ def launch_indexing(storage_directory: Optional[Path]=None):
def shutdown_indexing(storage_directory: Optional[Path]=None):
if not storage_directory:
storage_directory = get_homedir()
Popen(["./shutdown_redis.sh"], cwd=(storage_directory / 'indexing'))
r = Redis(unix_socket_path=get_socket_path('indexing'))
r.save()
r.shutdown()
print('Redis indexing database shutdown.')
def launch_all():

View File

@ -1,6 +0,0 @@
#!/bin/bash
# set -e
set -x
../../redis/src/redis-cli -s ./cache.sock shutdown

View File

@ -1,6 +0,0 @@
#!/bin/bash
# set -e
set -x
../../redis/src/redis-cli -s ./indexing.sock shutdown