Permalink
Browse files

only do some lazy loading of the apps

  • Loading branch information...
almet committed Aug 16, 2012
1 parent 9b28b38 commit c1ac5ddf998e8582e3a07b7e1163f1a646ee6fd9
Showing with 2 additions and 14 deletions.
  1. +2 −14 loadtest.py
View
@@ -53,21 +53,9 @@ def get(self, url, *args, **kwargs):
@property
def apps(self):
- def _build_app_list(max_retry=10):
- try:
- return random.sample(self.get_apps(), 4)
- except:
- if max_retry > 0:
- return _build_app_list(max_retry - 1)
- else:
- # if we fail more than max_retry times, return an hardcoded
- # list.
- return ['galactians2', 'ghosts-vs-zombies',
- 'fullscreen-clock', 'my-chat-place']
-
if self._apps is None:
- self._apps = _build_app_list()
- self.logger.info('apps: "%s"' % ', '.join(self._apps))
+ self._apps = random.sample(self.get_apps(), 4)
+ self.logger.info('apps: "%s"' % ', '.join(self._apps))
return self._apps
def get_apps(self):

0 comments on commit c1ac5dd

Please sign in to comment.