2019-10-01 23:42:35 +02:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
BASE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../..")
|
|
|
|
sys.path.append(BASE_DIR)
|
|
|
|
|
2020-01-08 00:06:39 +01:00
|
|
|
from scripts.lib.setup_path import setup_path
|
|
|
|
|
|
|
|
setup_path()
|
|
|
|
|
2020-05-09 22:23:33 +02:00
|
|
|
import bmemcached
|
2019-10-01 23:42:35 +02:00
|
|
|
|
2020-06-11 00:54:34 +02:00
|
|
|
from zproject import settings
|
|
|
|
|
2020-05-09 22:23:33 +02:00
|
|
|
cache = settings.CACHES["default"]
|
|
|
|
assert isinstance(cache, dict) # for mypy
|
2024-07-16 22:33:14 +02:00
|
|
|
client = bmemcached.Client((cache["LOCATION"],), **cache["OPTIONS"])
|
|
|
|
try:
|
|
|
|
client.flush_all()
|
|
|
|
finally:
|
|
|
|
client.disconnect_all()
|