summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo Fitoria <adolfo.fitoria@gmail.com>2012-05-09 17:49:27 -0600
committerAdolfo Fitoria <adolfo.fitoria@gmail.com>2012-05-09 17:49:27 -0600
commitc5d8de6ed81b519b998faeb0c17d6ed3cdae96b1 (patch)
treee55f98d6ed1680db195390496406d1be213fbe26
parent130bbd2c6b3f8133d13151da935cc22e0ced38a7 (diff)
downloadaskbot-c5d8de6ed81b519b998faeb0c17d6ed3cdae96b1.tar.gz
askbot-c5d8de6ed81b519b998faeb0c17d6ed3cdae96b1.tar.bz2
askbot-c5d8de6ed81b519b998faeb0c17d6ed3cdae96b1.zip
added management command to preload livesettings cache
-rw-r--r--askbot/management/commands/preload_livesettings_cache.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/askbot/management/commands/preload_livesettings_cache.py b/askbot/management/commands/preload_livesettings_cache.py
new file mode 100644
index 00000000..431572c4
--- /dev/null
+++ b/askbot/management/commands/preload_livesettings_cache.py
@@ -0,0 +1,17 @@
+from django.core.management.base import NoArgsCommand
+from askbot.conf import settings
+
+class Command(NoArgsCommand):
+ '''Loads livesettings values to cache helping speed up
+ initial load time for the users'''
+
+ def handle_noargs(self, **options):
+ empty1 = emtpy2 = None
+ print 'loading cache'
+ #Just loads all the settings that way they will be in the cache
+ for key, value in settings._ConfigSettings__instance.items():
+ empty1 = key
+ empty2 = value
+ print 'cache pre-loaded'
+
+