Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. headers = {
  2. 'Authorization': 'Bearer {0}'.format(token),
  3. }
  4.  
  5. qsargs = {
  6. 'select': '*',
  7. 'limit': 1000,
  8. }
  9.  
  10. while True:
  11. response = requests.get(url, params=qsargs, headers=headers)
  12. data = response.json()
  13.  
  14. for app in data['model']:
  15. yield app
  16.  
  17. if '_next' in data:
  18. url = data['_next']['model']['nextUrl']
  19. qsargs = None
  20.  
  21. else:
  22. return
  23.  
  24. eapp_name = eapp['name'].strip()
  25.  
  26. futures = list()
  27. with ThreadPoolExecutor(max_workers=5) as executor:
  28. for app in get_applications(token):
  29. # future = executor.submit(update_application, app)
  30. # futures.append(future)
  31. update_application(token, app)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement