1
0
mirror of https://github.com/peeringdb/peeringdb.git synced 2024-05-11 05:55:09 +00:00

use debug print (#1460)

* use debug print

* suppress python warnings during whois
This commit is contained in:
Stefan Pratter
2023-10-25 17:48:52 +03:00
committed by GitHub
parent d33da3297d
commit 36489e2921
2 changed files with 7 additions and 2 deletions

View File

@ -4,6 +4,11 @@
import logging
import os
import sys
import warnings
# supress warnings
warnings.filterwarnings("ignore")
# print "path", sys.path

View File

@ -258,7 +258,7 @@ def get_cache_backend(cache_name):
if cache_backend == "RedisCache":
if can_ping_redis(REDIS_HOST, REDIS_PORT, REDIS_PASSWORD):
print("Was able to ping Redis, using RedisCache")
print_debug("Was able to ping Redis, using RedisCache")
return {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": f"redis://:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}",
@ -270,7 +270,7 @@ def get_cache_backend(cache_name):
cache_backend = (
"DatabaseCache" if cache_name == "session" else "LocMemCache"
)
print(f"Was not able to ping Redis, falling back to {cache_backend}")
print_debug(f"Was not able to ping Redis, falling back to {cache_backend}")
if cache_backend == "LocMemCache":
return {