(self, doc, is_deleted)
This function does actual cache invalidation. It's also called manually
        by directly invalidated things.
This function does actual cache invalidation. It's also called manually
        by directly invalidated things.
This function does actual cache invalidation . It s also called manually by directly invalidated things .
def process_doc(self, doc, is_deleted):
        """
        This function does actual cache invalidation. It's also called manually
        by directly invalidated things.
        """
        doc_id = doc['_id']
        if doc_id.startswith('pillowtop_corehq.pillows'):
            return None

        # send document to cache invalidation workflow
        generations_prior = set(self.get_generations())
        cache_core.invalidate_doc(doc, deleted=is_deleted)
        generations_after = set(self.get_generations())

        generation_change = generations_prior.symmetric_difference(generations_after)
        if len(generation_change) > 0:
            pillow_logging.debug("[CacheInvalidate]: Change %s (%s), generation change: %s" % (
                doc_id, doc.get('doc_type', 'unknown'), ', '.join(generation_change))
            )
        else:
            pillow_logging.debug(
                "[CacheInvalidate]: Change %s (%s), no generation change" % (
                    doc_id, doc.get('doc_type', 'unknown')
                )
            )
def process_doc ( self , doc , is_deleted ) : doc_id = doc [ '_id' ] if doc_id . startswith ( 'pillowtop_corehq.pillows' ) : return None # send document to cache invalidation workflow generations_prior = set ( self . get_generations ( ) ) cache_core . invalidate_doc ( doc , deleted = is_deleted ) generations_after = set ( self . get_generations ( ) ) generation_change = generations_prior . symmetric_difference ( generations_after ) if len ( generation_change ) > 0 : pillow_logging . debug ( "[CacheInvalidate]: Change %s (%s), generation change: %s" % ( doc_id , doc . get ( 'doc_type' , 'unknown' ) , ', ' . join ( generation_change ) ) ) else : pillow_logging . debug ( "[CacheInvalidate]: Change %s (%s), no generation change" % ( doc_id , doc . get ( 'doc_type' , 'unknown' ) ) )