zulip/scripts/setup/flush-memcached

24 lines
540 B
Plaintext
Raw Normal View History

#!/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)
from scripts.lib.setup_path import setup_path
setup_path()
import pylibmc
from zproject import settings
assert isinstance(settings.CACHES["default"], dict) # for mypy
pylibmc.Client(
[settings.MEMCACHED_LOCATION],
binary=True,
username=settings.MEMCACHED_USERNAME,
password=settings.MEMCACHED_PASSWORD,
behaviors=settings.CACHES["default"]["OPTIONS"],
).flush_all()