Skip to content
Snippets Groups Projects
Commit 7227d04f authored by ale's avatar ale
Browse files

provide some progress feedback on stdout

parent 95ee6a06
No related branches found
No related tags found
No related merge requests found
import os
import optparse
import logging
import sys
import time
from djrandom import daemonize
from djrandom import utils
......@@ -12,9 +13,12 @@ log = logging.getLogger(__name__)
def fix_solr():
print 'rebuilding the SOLR index...'
for mp3 in MP3.query:
for count, mp3 in enumerate(MP3.query):
indexer.add_mp3(mp3)
print 'commit...'
if count % 100 == 0:
sys.stdout.write('%d \r' % count)
sys.stdout.flush()
print '\ncommit...'
indexer.commit()
print 'done.'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment