#NEWLINE# def update( self ) : #NEWLINE# #INDENT# 'update feeds' #NEWLINE# loop = self . bot . loop #NEWLINE# loop . call_later ( self . delay , self . update ) #NEWLINE# now = time . time ( ) #NEWLINE# session = self . session #NEWLINE# feeds = [ dict ( f , session = session ) for f in self . feeds . values ( ) if ( f [ 'time' ] < ( now - f [ 'delay' ] ) ) ] #NEWLINE# if task : #NEWLINE# #INDENT# self . bot . log . info ( 'Fetching feeds %s' , ', ' . join ( [ f [ 'name' ] for f in feeds ] ) ) #NEWLINE# tasks = [ ] #NEWLINE# for feed in feeds : #NEWLINE# #INDENT# task = loop . run_in_executor ( None , fetch , feed ) #NEWLINE# task . add_done_callback ( self . update_time ) #NEWLINE# tasks . append ( task ) #NEWLINE# #UNINDENT# task = self . bot . create_task ( asyncio . wait ( tasks , timeout = ( len ( feeds ) * 2 ) , loop = loop ) ) #NEWLINE# task . add_done_callback ( self . parse )