@cronjobs.register
def update_addons_collections_downloads():
 raise_if_reindex_in_progress('amo')
 d = AddonCollectionCount.objects.values('addon', 'collection').annotate(sum=Sum('count'))
 ts = [tasks.update_addons_collections_downloads.subtask(args=[chunk]) for chunk in chunked(d, 100)]
 TaskSet(ts).apply_async()

@ cronjobs . register def update_addons_collections_downloads ( ) : raise_if_reindex_in_progress ( 'amo' ) d = AddonCollectionCount . objects . values ( 'addon' , 'collection' ) . annotate ( sum = Sum ( 'count' ) ) ts = [ tasks . update_addons_collections_downloads . subtask ( args = [ chunk ] ) for chunk in chunked ( d , 100 ) ] TaskSet ( ts ) . apply_async ( )
update addons+collections download totals .