Revert "utils: cache warehouses (#27412)"

This reverts commit ba2c0c4fab.
This commit is contained in:
Valentin Deniaud 2019-11-25 15:06:11 +01:00
parent 039e32fb83
commit 90a5bb49c4
2 changed files with 0 additions and 6 deletions

View File

@ -19,7 +19,6 @@ import glob
import json
from django.conf import settings
from django.core.cache import cache
from django.db import connection
from django.utils.translation import ugettext as _
@ -27,8 +26,6 @@ from .schemas import Warehouse
def get_warehouses():
if cache.get('warehouses_cache'):
return cache.get('warehouses_cache')
warehouses = []
for pattern in settings.BIJOE_SCHEMAS:
for path in glob.glob(pattern):
@ -37,7 +34,6 @@ def get_warehouses():
pattern = os.path.join(connection.tenant.get_directory(), 'schemas', '*.model')
for path in glob.glob(pattern):
warehouses.append(Warehouse.from_json(json.load(open(path))))
cache.set('warehouses_cache', warehouses, 30)
return warehouses

View File

@ -15,7 +15,6 @@ import psycopg2
from django.db import connection
from django.contrib.auth.models import User
from django.core.cache import cache
from django.core.management import call_command
@ -53,7 +52,6 @@ SCHEMA_PATHS = os.path.join(os.path.dirname(__file__), 'fixtures/')
def load_schema_db(schema):
import random
cache.delete('warehouses_cache')
database_name = 'db%s' % random.getrandbits(20)
tmpdir = tempfile.mkdtemp()
bijoe_schema_dir = os.path.join(tmpdir, 'schemas')