speedup rebuildcache
This commit is contained in:
parent
dab85ad4fc
commit
351386df82
1 changed files with 2 additions and 2 deletions
|
@ -20,8 +20,8 @@ class Command(BaseCommand):
|
||||||
def handle(self, **options):
|
def handle(self, **options):
|
||||||
offset = 0
|
offset = 0
|
||||||
chunk = 100
|
chunk = 100
|
||||||
pos = models.Item.objects.count()
|
count = pos = models.Item.objects.count()
|
||||||
while offset <= models.Item.objects.count():
|
while offset <= count:
|
||||||
for i in models.Item.objects.all().order_by('id')[offset:offset+chunk]:
|
for i in models.Item.objects.all().order_by('id')[offset:offset+chunk]:
|
||||||
print pos, i.itemId
|
print pos, i.itemId
|
||||||
i.save()
|
i.save()
|
||||||
|
|
Loading…
Reference in a new issue