From d62460e5fea8119eb502d5e1734bb3115f8d9667 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 15 Jul 2013 12:49:05 +0000 Subject: [PATCH] dont reload config in manage.py commands, fixes #1619 --- pandora/app/config.py | 3 ++- pandora/item/management/commands/get_frame.py | 2 ++ pandora/item/management/commands/sqlfindindex.py | 1 + pandora/item/management/commands/sync_itemsort.py | 2 ++ pandora/settings.py | 3 ++- 5 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pandora/app/config.py b/pandora/app/config.py index 8de4fad4..aabfdae3 100644 --- a/pandora/app/config.py +++ b/pandora/app/config.py @@ -273,7 +273,8 @@ def update_geoip(force=False): def init(): if not settings.RELOADER_RUNNING: load_config() - thread.start_new_thread(reloader_thread, ()) + if settings.RELOAD_CONFIG: + thread.start_new_thread(reloader_thread, ()) def shutdown(): if settings.RELOADER_RUNNING: diff --git a/pandora/item/management/commands/get_frame.py b/pandora/item/management/commands/get_frame.py index 06910f0d..b5e9d551 100644 --- a/pandora/item/management/commands/get_frame.py +++ b/pandora/item/management/commands/get_frame.py @@ -1,7 +1,9 @@ # -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 from django.core.management.base import BaseCommand +from django.conf import settings +settings.RELOAD_CONFIG = False import app.monkey_patch from ... import models diff --git a/pandora/item/management/commands/sqlfindindex.py b/pandora/item/management/commands/sqlfindindex.py index 5dbaabc9..3d4d8f76 100644 --- a/pandora/item/management/commands/sqlfindindex.py +++ b/pandora/item/management/commands/sqlfindindex.py @@ -6,6 +6,7 @@ from django.core.management.base import BaseCommand from django.db import connection, transaction from django.conf import settings +settings.RELOAD_CONFIG = False import app.monkey_patch from ... import models diff --git a/pandora/item/management/commands/sync_itemsort.py b/pandora/item/management/commands/sync_itemsort.py index e5f94fd0..69804621 100644 --- a/pandora/item/management/commands/sync_itemsort.py +++ b/pandora/item/management/commands/sync_itemsort.py @@ -5,7 +5,9 @@ from optparse import make_option from django.core.management.base import BaseCommand from django.db import connection, transaction from django.db.models import fields +from django.conf import settings +settings.RELOAD_CONFIG = False import app.monkey_patch from ... import models import clip.models diff --git a/pandora/settings.py b/pandora/settings.py index a8d31806..a52428dc 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -172,7 +172,7 @@ BROKER_PORT = 5672 BROKER_USER = "pandora" BROKER_PASSWORD = "box" BROKER_VHOST = "/pandora" -SEND_CELERY_ERROR_EMAILS=False +SEND_CELERY_ERROR_EMAILS = False #with apache x-sendfile or lighttpd set this to True XSENDFILE = False @@ -182,6 +182,7 @@ XACCELREDIRECT = False SITE_CONFIG = join(PROJECT_ROOT, 'config.jsonc') DEFAULT_CONFIG = join(PROJECT_ROOT, 'config.pandora.jsonc') +RELOAD_CONFIG = True #used if CONFIG['video']['download'] is set TRACKER_URL="udp://tracker.openbittorrent.com:80"