0d5eb96adeb12ecc2c2a1fd4554cc6a01c5c5b98,apps/search/models.py,MUserSearch,index_subscriptions_for_search,#MUserSearch#,48

Before Change


            processed += 1
            
            // Throttle notifications to client as to not flood them
            if time.time() - throttle > 0.05:
                r.publish(user.username, "search_index_complete:%.4s" % (float(processed)/total))
                throttle = time.time()
        
        duration = time.time() - start
        logging.user(user, "~FCIndexed ~SB%s/%s feeds~SN for ~SB~FB%s~FC~SN in ~FM~SB%s~FC~SN sec." % 
                     (processed, total, user.username, round(duration, 2)))
        r.publish(user.username, "search_index_complete:done")

After Change


        subscriptions = UserSubscription.objects.filter(user=user).only("feed")
        total = subscriptions.count()
        
        feed_ids = []
        for sub in subscriptions:
            try:
                feed_ids.append(sub.feed.pk)
            except Feed.DoesNotExist:
                continue
        
        feed_id_chunks = [c for c in chunks(feed_ids, 6)]
        logging.user(user, "~FCIndexing ~SB%s feeds~SN in %s chunks..." % 
                     (total, len(feed_id_chunks)))
        
        tasks = [IndexSubscriptionsChunkForSearch().s(feed_ids=feed_id_chunk,
                                                      user_id=self.user_id
                                                      ).set(queue="search_indexer")
                 for feed_id_chunk in feed_id_chunks]
        group = celery.group(*tasks)
        res = group.apply_async(queue="search_indexer")
        res.join_native()
        
        duration = time.time() - start
        logging.user(user, "~FCIndexed ~SB%s feeds~SN in ~FM~SB%s~FC~SN sec." % 
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: samuelclay/NewsBlur
Commit Name: 0d5eb96adeb12ecc2c2a1fd4554cc6a01c5c5b98
Time: 2014-04-22
Author: samuel@ofbrooklyn.com
File Name: apps/search/models.py
Class Name: MUserSearch
Method Name: index_subscriptions_for_search


Project Name: cmu-db/ottertune
Commit Name: c8fbaf6e4b8c62cf7542fd0433dc6010097103e9
Time: 2019-09-26
Author: arifiorino@gmail.com
File Name: server/website/website/views.py
Class Name:
Method Name: handle_result_files


Project Name: instacart/lore
Commit Name: f863a6804ba1f46c3f216c6ba75b642b9b61ad17
Time: 2018-02-01
Author: montanalow@users.noreply.github.com
File Name: lore/pipelines/holdout.py
Class Name: Base
Method Name: encode_x


Project Name: deepchem/deepchem
Commit Name: 1c07a01ae1268ca316981cf6be9a826e4691b5e4
Time: 2018-08-14
Author: peastman@stanford.edu
File Name: deepchem/feat/rdkit_grid_featurizer.py
Class Name: RdkitGridFeaturizer
Method Name: featurize_complexes