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:
Tim Abbott
2017-02-26 20:46:17 -08:00
parent 6bdefb92e9
commit 8691f1466a

View File

@@ -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