mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 04:53:36 +00:00
populate_db: Disable use of memcached when populating database.
This fixes an issue where one would get errors of the form: `ValueError: unsupported pickle protocol: 3` in a `run-dev.py` server run against Python 2 if you ran `provision`. Provision currently runs `populate_db` with Python 3, storing Python 3 based data in memcached, which then can't be read by Python 2.
This commit is contained in:
@@ -25,6 +25,12 @@ from six.moves import range
|
||||
from typing import Any, Callable, Dict, List, Iterable, Mapping, Sequence, Set, Tuple, Text
|
||||
|
||||
settings.TORNADO_SERVER = None
|
||||
# Disable using memcached caches to avoid 'unsupported pickle
|
||||
# protocol' errors if `populate_db` is run with a different Python
|
||||
# from `run-dev.py`.
|
||||
settings.CACHES['default'] = {
|
||||
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'
|
||||
}
|
||||
|
||||
def create_users(realm, name_list, bot_type=None):
|
||||
# type: (Realm, Iterable[Tuple[Text, Text]], int) -> None
|
||||
|
||||
Reference in New Issue
Block a user