Skip to content

Commit

Permalink
🐛 Fix with new thread pool.
Browse files Browse the repository at this point in the history
  • Loading branch information
ssundarraj committed Apr 7, 2015
1 parent a760c4d commit 6612fe6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions image_scraper/mains.py
Expand Up @@ -49,12 +49,12 @@ def console_main():
widgets = ['Progress: ', Percentage(), ' ', Bar(marker=RotatingMarker()),
' ', ETA(), ' ', FileTransferSpeed()]
pbar = ProgressBar(widgets=widgets, maxval=100).start()
pool = SimplePool.threadpool()
pool = SimplePool.ThreadPool()
status_lock = threading.Lock()
for img_url in scraper.images:
if status_flags['count'] == scraper.no_to_download:
break
download_job = SimplePool.thread_job(download_worker_fn, (scraper, img_url, pbar, status_flags, status_lock))
download_job = SimplePool.ThreadJob(download_worker_fn, (scraper, img_url, pbar, status_flags, status_lock))
pool.add_job(download_job)
status_flags['count'] += 1

Expand Down

0 comments on commit 6612fe6

Please sign in to comment.