Skip to content
This repository has been archived by the owner on Feb 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #4510 from dciangot/FIFO_removal
Browse files Browse the repository at this point in the history
FIFO remove and messages for monitor
  • Loading branch information
mmascher authored Oct 25, 2016
2 parents f066034 + f469f83 commit c29213d
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions src/python/AsyncStageOut/TransferDaemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,17 @@ def active_users(self, db):
self.logger.exception('A problem occured when contacting couchDB: %s' % e)
return []

active_users = []
if len(users['rows']) <= self.config.pool_size:
active_users = users['rows']
def keys_map(inputDict):
"""
Map function.
"""
return inputDict['key']
active_users = map(keys_map, active_users)
else:
sorted_users = self.factory.loadObject(self.config.algoName, args = [self.config, self.logger, users['rows'], self.config.pool_size], getFromCache = False, listFlag = True)
#active_users = random.sample(users['rows'], self.config.pool_size)
active_users = sorted_users()[:self.config.pool_size]
self.logger.info('%s active users' % len(active_users))
self.logger.debug('Active users are: %s' % active_users)
active_users = [ x['key'] for x in users['rows'] ]

self.logger.info('Requested %s active users' % len(active_users))
self.logger.debug('Requested active users are: %s' % active_users)

if not len(active_users) <= self.config.pool_size:
active_users = active_users[:self.config.pool_size]

self.logger.info('Selecting %s active users' % len(active_users))
self.logger.debug('Selected active users are: %s' % active_users)

return active_users

def active_sites(self):
Expand Down

0 comments on commit c29213d

Please sign in to comment.