diff --git a/_modules/CveXplore/database/maintenance/DownloadHandler.html b/_modules/CveXplore/database/maintenance/DownloadHandler.html index baba008e..7eeb0a21 100644 --- a/_modules/CveXplore/database/maintenance/DownloadHandler.html +++ b/_modules/CveXplore/database/maintenance/DownloadHandler.html @@ -263,6 +263,8 @@

Source code for CveXplore.database.maintenance.DownloadHandler

try: if self.feed_type.lower() == "epss": self.database["cves"].bulk_write(batch, ordered=False) + elif self.feed_type.lower() == "cves" or self.feed_type.lower() == "cpe": + self.database[self.feed_type.lower()].insert_many(batch, ordered=False) else: self.database[self.feed_type.lower()].bulk_write(batch, ordered=False) except BulkWriteError as err: diff --git a/_modules/CveXplore/database/maintenance/Sources_process.html b/_modules/CveXplore/database/maintenance/Sources_process.html index 8e12ddbf..be73b46c 100644 --- a/_modules/CveXplore/database/maintenance/Sources_process.html +++ b/_modules/CveXplore/database/maintenance/Sources_process.html @@ -335,13 +335,13 @@

Source code for CveXplore.database.maintenance.Sources_process

def update(self, **kwargs): self.logger.info("CPE database update started") + self.process_downloads() + # if collection is non-existent; assume it's not an update if self.feed_type.lower() not in self.getTableNames(): DatabaseIndexer().create_indexes(collection=self.feed_type.lower()) self.is_update = False - self.process_downloads() - self.logger.info("Finished CPE database update") return self.last_modified @@ -357,10 +357,10 @@

Source code for CveXplore.database.maintenance.Sources_process

self.dropCollection(self.feed_type.lower()) - DatabaseIndexer().create_indexes(collection=self.feed_type.lower()) - self.process_downloads() + DatabaseIndexer().create_indexes(collection=self.feed_type.lower()) + self.logger.info("Finished CPE database population") return self.last_modified
@@ -901,13 +901,13 @@

Source code for CveXplore.database.maintenance.Sources_process

def update(self): self.logger.info("CVE database update started") + self.process_downloads() + # if collection is non-existent; assume it's not an update if self.feed_type.lower() not in self.getTableNames(): DatabaseIndexer().create_indexes(collection=self.feed_type.lower()) self.is_update = False - self.process_downloads() - self.logger.info("Finished CVE database update") return self.last_modified @@ -929,10 +929,10 @@

Source code for CveXplore.database.maintenance.Sources_process

self.dropCollection(self.feed_type.lower()) - DatabaseIndexer().create_indexes(collection=self.feed_type.lower()) - self.process_downloads() + DatabaseIndexer().create_indexes(collection=self.feed_type.lower()) + self.logger.info("Finished CVE database population") return self.last_modified
@@ -1263,6 +1263,7 @@

Source code for CveXplore.database.maintenance.Sources_process

MongoAddIndex( index=[("padded_version", ASCENDING)], name="padded_version" ), + MongoAddIndex(index=[("lastModified", ASCENDING)], name="lastModified"), ], "cpeother": [ MongoUniqueIndex(index=[("id", ASCENDING)], name="id", unique=True)