Skip to content

Instantly share code, notes, and snippets.

@svetlyak40wt
Created May 20, 2016 10:31
Show Gist options
  • Save svetlyak40wt/9f96fb758b44e92ac6cbdb1af0675cbb to your computer and use it in GitHub Desktop.
Save svetlyak40wt/9f96fb758b44e92ac6cbdb1af0675cbb to your computer and use it in GitHub Desktop.
Bad python code example
for p in range ( 0, iteration if iteration<5 else 5 ):
threads = list()
up = len_ids/iteration*(p+1) if p!=iteration else len_ids-1
part_payloads['ids'] = ','.join(list(map(str, payloads['ids'][p*len_ids/iteration:up] )))
threads.append(gevent.spawn(self.request, part_payloads))
gevent.joinall(threads)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment