data/secscan_model/secscan_v2_model.py
def perform_indexing(self, start_token=None):
        """
        Performs indexing of the next set of unindexed manifests/images.

        If start_token is given, the indexing should resume from that point. Returns a new start
        index for the next iteration of indexing. The tokens returned and given are assumed to be
        opaque outside of this implementation and should not be relied upon by the caller to conform
        to any particular format.
        """
        # NOTE: This import is in here because otherwise this class would depend upon app.
        # Its not great, but as this is intended to be legacy until its removed, its okay.
        from util.secscan.analyzer import PreemptedException

        iterator, next_token = self._candidates_to_scan(start_token)
        if iterator is None:
            logger.debug("Found no additional images to scan")
            return None

        with UseThenDisconnect(self.app.config):
            for candidate, abt, num_remaining in iterator:
                try:
                    self._analyzer.analyze_recursively(candidate)
                except PreemptedException:
                    logger.info("Another worker pre-empted us for layer: %s", candidate.id)
                    abt.set()
                except APIRequestFailure:
                    logger.exception("Security scanner service unavailable")
                    return

                unscanned_images.set(num_remaining)

        return next_token

        Performs indexing of the next set of unindexed manifests/images.

        If start_token is given, the indexing should resume from that point. Returns a new start
        index for the next iteration of indexing. The tokens returned and given are assumed to be
        opaque outside of this implementation and should not be relied upon by the caller to conform
        to any particular format.
        
Performs indexing of the next set of unindexed manifests/images.
If start_token is given, the indexing should resume from that point. Returns a new start
index for the next iteration of indexing. The tokens returned and given are assumed to be
opaque outside of this implementation and should not be relied upon by the caller to conform
to any particular format.
Performs indexing of the next set of unindexed manifests / images . If start_token is given the indexing should resume from that point . Returns a new start index for the next iteration of indexing . The tokens returned and given are assumed to be opaque outside of this implementation and should not be relied upon by the caller to conform to any particular format .
def perform_indexing(self, start_token=None):
        from util.secscan.analyzer import PreemptedException
        iterator, next_token = self._candidates_to_scan(start_token)
        if iterator is None:
            logger.debug("Found no additional images to scan")
            return None
        with UseThenDisconnect(self.app.config):
            for candidate, abt, num_remaining in iterator:
                try:
                    self._analyzer.analyze_recursively(candidate)
                except PreemptedException:
                    logger.info("Another worker pre-empted us for layer: %s", candidate.id)
                    abt.set()
                except APIRequestFailure:
                    logger.exception("Security scanner service unavailable")
                    return
                unscanned_images.set(num_remaining)
        return next_token
def perform_indexing ( self , start_token = None ) : from util . secscan . analyzer import PreemptedException iterator , next_token = self . _candidates_to_scan ( start_token ) if iterator is None : logger . debug ( "Found no additional images to scan" ) return None with UseThenDisconnect ( self . app . config ) : for candidate , abt , num_remaining in iterator : try : self . _analyzer . analyze_recursively ( candidate ) except PreemptedException : logger . info ( "Another worker pre-empted us for layer: %s" , candidate . id ) abt . set ( ) except APIRequestFailure : logger . exception ( "Security scanner service unavailable" ) return unscanned_images . set ( num_remaining ) return next_token
Performs indexing of the next set of unindexed manifests/images.
Performs indexing of the next set of unindexed manifests / images .
"""
        Performs indexing of the next set of unindexed manifests/images.

        If start_token is given, the indexing should resume from that point. Returns a new start
        index for the next iteration of indexing. The tokens returned and given are assumed to be
        opaque outside of this implementation and should not be relied upon by the caller to conform
        to any particular format.
        """ # NOTE: This import is in here because otherwise this class would depend upon app. # Its not great, but as this is intended to be legacy until its removed, its okay.
self
start_token