def db_update(config: str, verbose: bool, db: str, debug_mode: bool): """ Update the DBs from the internet. Will update all DBs if DB not specified. """ m = CVDUpdate(config=config, verbose=verbose) errors = m.db_update(db, debug_mode) if errors > 0: sys.exit(errors)
def _update(interval: int) -> None: """Don't call this directly Updates the AV db after every "interval" seconds when it was started :param interval: the interval in seconds between 2 updates of the db """ ticker = Event() m = CVDUpdate() m.logger.info(f"Updating the database every {interval} seconds") while not ticker.wait(interval): errors = m.db_update(debug_mode=True) if errors > 0: m.logger.error("Failed to fetch updates from ClamAV databases")