suppress warnings

This commit is contained in:
Kenneth Kehl
2024-09-27 12:38:27 -07:00
parent 16b357faa8
commit e99f4bc6b5
3 changed files with 12 additions and 2 deletions

View File

@@ -196,8 +196,11 @@ def get_s3_files():
current_app.logger.info(
f"job_cache length before regen: {len(job_cache)} #notify-admin-1200"
)
try:
with ThreadPoolExecutor() as executor:
executor.map(lambda key: read_s3_file(bucket_name, key, s3res), object_keys)
except Exception:
current_app.logger.exception("Connection pool issue")
current_app.logger.info(
f"job_cache length after regen: {len(job_cache)} #notify-admin-1200"

View File

@@ -13,6 +13,7 @@ AWS_CLIENT_CONFIG = Config(
"addressing_style": "virtual",
},
use_fips_endpoint=True,
max_pool_connections=50,
)

View File

@@ -39,6 +39,12 @@ def init_app(app):
for logger_instance, handler in product(warning_loggers, handlers):
logger_instance.addHandler(handler)
logger_instance.setLevel(logging.WARNING)
# Suppress specific loggers to prevent leaking sensitive info
logging.getLogger("boto3").setLevel(logging.ERROR)
logging.getLogger("botocore").setLevel(logging.ERROR)
logging.getLogger("urllib3").setLevel(logging.ERROR)
app.logger.info("Logging configured")