forked from 0x2620/pandora
use UTC by default, slow rebuild
This commit is contained in:
parent
ee9135bf04
commit
b333f447f6
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue