def clear_expired_exceptions(): """ Clears out the exception logs table of all exception entries that have expired past the TTL. :return: """ app.logger.info("Clearing out exceptions that have an expired TTL...") clear_old_exceptions() app.logger.info("Completed clearing out exceptions that have an expired TTL.")
def clear_expired_exceptions(): """ Clears out the exception logs table of all exception entries that have expired past the TTL. :return: """ print("Clearing out exceptions that have an expired TTL...") clear_old_exceptions() print("Completed clearing out exceptions that have an expired TTL.")
def test_exception_clearing(self): location = ("iamrole", "testing", "us-west-2", "testrole") for i in range(0, 5): try: raise ValueError("This is test: {}".format(i)) except ValueError as e: test_exception = e store_exception("tests", location, test_exception, ttl=(datetime.datetime.now() - datetime.timedelta(days=1))) store_exception("tests", location, test_exception) clear_old_exceptions() # Get all the exceptions: exc_list = ExceptionLogs.query.all() assert len(exc_list) == 1
def clear_expired_exceptions(): app.logger.info("[ ] Clearing out exceptions that have an expired TTL...") clear_old_exceptions() app.logger.info( "[-] Completed clearing out exceptions that have an expired TTL.")
def _clear_old_exceptions(): print("Clearing out exceptions that have an expired TTL...") clear_old_exceptions() print("Completed clearing out exceptions that have an expired TTL.")
def clear_expired_exceptions(): app.logger.info("[ ] Clearing out exceptions that have an expired TTL...") clear_old_exceptions() app.logger.info("[-] Completed clearing out exceptions that have an expired TTL.")