From b333f447f678fbad6a37dc5d0ad54173283c39d4 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 11 Nov 2011 00:27:14 +0100 Subject: [PATCH] use UTC by default, slow rebuild --- pandora/item/management/commands/rebuildcache.py | 5 ++++- pandora/settings.py | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pandora/item/management/commands/rebuildcache.py b/pandora/item/management/commands/rebuildcache.py index 7bd8d83a..8600d02c 100644 --- a/pandora/item/management/commands/rebuildcache.py +++ b/pandora/item/management/commands/rebuildcache.py @@ -3,6 +3,7 @@ import os from os.path import join, dirname, basename, splitext, exists +import time from django.core.management.base import BaseCommand, CommandError from django.conf import settings @@ -20,11 +21,13 @@ class Command(BaseCommand): def handle(self, **options): offset = 0 - chunk = 100 + chunk = 50 count = pos = models.Item.objects.count() while offset <= count: for i in models.Item.objects.all().order_by('id')[offset:offset+chunk]: print pos, i.itemId i.save() + time.sleep(1) #dont overload db pos -= 1 offset += chunk + time.sleep(30) #dont overload db diff --git a/pandora/settings.py b/pandora/settings.py index 16315ad4..59992bbe 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -24,7 +24,8 @@ MANAGERS = ADMINS # although not all choices may be available on all operating systems. # If running in a Windows environment this must be set to the same as your # system time zone. -TIME_ZONE = 'Europe/Berlin' +TIME_ZONE = 'UTC' + #TIME_ZONE = 'Asia/Kolkata' # Language code for this installation. All choices can be found here: