Beispiel #1
0
    def process_item(self, item):

        if self.is_update:
            self.queue.put(
                DatabaseAction(
                    action=DatabaseAction.actions.UpdateOne,
                    collection=self.feed_type.lower(),
                    doc=item,
                ))
        else:
            self.queue.put(
                DatabaseAction(
                    action=DatabaseAction.actions.InsertOne,
                    collection=self.feed_type.lower(),
                    doc=item,
                ))
Beispiel #2
0
    def process_item(self, item):
        cpe = self.process_cpe_item(item)

        if cpe is not None:
            if self.is_update:
                self.queue.put(
                    DatabaseAction(
                        action=DatabaseAction.actions.UpdateOne,
                        collection=self.feed_type.lower(),
                        doc=cpe,
                    ))
            else:
                self.queue.put(
                    DatabaseAction(
                        action=DatabaseAction.actions.InsertOne,
                        collection=self.feed_type.lower(),
                        doc=cpe,
                    ))
Beispiel #3
0
    def process_item(self, item):
        cve = self.process_cve_item(item)

        if cve is not None:
            if self.is_update:
                self.queue.put(
                    DatabaseAction(
                        action=DatabaseAction.actions.UpdateOne,
                        collection=self.feed_type.lower(),
                        doc=cve,
                        update_watchlist=self.update_watchlist,
                        signal_groups = self.signal_groups
                    )
                )                   
            else:
                self.queue.put(
                    DatabaseAction(
                        action=DatabaseAction.actions.InsertOne,
                        collection=self.feed_type.lower(),
                        doc=cve,
                        update_watchlist=self.update_watchlist,
                        signal_groups = self.signal_groups
                    )
                )