diff --git a/src/caosadvancedtools/crawler.py b/src/caosadvancedtools/crawler.py index 5dccdd8ce04daf6b6c15c676d195ce02c8d6ae12..a01b13ca5b5ef61163e77063e68a3ca938bfbf84 100644 --- a/src/caosadvancedtools/crawler.py +++ b/src/caosadvancedtools/crawler.py @@ -310,8 +310,6 @@ class Crawler(object): if self.interactive and "y" != input("Do you want to continue? (y)"): return - logger.info("Inserting or updating Records...") - for cfood in cfoods: try: cfood.create_identifiables() @@ -544,6 +542,10 @@ carefully and if the changes are ok, click on the following link: logger.debug(cfood.to_be_updated) try: + if len(cfood.to_be_updated) > 0: + logger.info( + "Updating {} Records...".format( + len(cfood.to_be_updated))) guard.safe_update(cfood.to_be_updated, unique=False) except FileNotFoundError as e: logger.info("Cannot access {}. However, it might be needed for" @@ -605,7 +607,11 @@ carefully and if the changes are ok, click on the following link: logger.debug("No new entities to be inserted.") else: try: - guard.safe_insert(missing_identifiables, unique=False) + if len(missing_identifiables) > 0: + logger.info( + "Inserting {} Records...".format( + len(missing_identifiables))) + guard.safe_insert(missing_identifiables, unique=False) except Exception as e: DataModelProblems.evaluate_exception(e)