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:
@ -4,6 +4,11 @@
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import warnings
|
||||||
|
|
||||||
|
# supress warnings
|
||||||
|
|
||||||
|
warnings.filterwarnings("ignore")
|
||||||
|
|
||||||
# print "path", sys.path
|
# print "path", sys.path
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ def get_cache_backend(cache_name):
|
|||||||
|
|
||||||
if cache_backend == "RedisCache":
|
if cache_backend == "RedisCache":
|
||||||
if can_ping_redis(REDIS_HOST, REDIS_PORT, REDIS_PASSWORD):
|
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 {
|
return {
|
||||||
"BACKEND": "django.core.cache.backends.redis.RedisCache",
|
"BACKEND": "django.core.cache.backends.redis.RedisCache",
|
||||||
"LOCATION": f"redis://:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}",
|
"LOCATION": f"redis://:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}",
|
||||||
@ -270,7 +270,7 @@ def get_cache_backend(cache_name):
|
|||||||
cache_backend = (
|
cache_backend = (
|
||||||
"DatabaseCache" if cache_name == "session" else "LocMemCache"
|
"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":
|
if cache_backend == "LocMemCache":
|
||||||
return {
|
return {
|
||||||
|
Reference in New Issue
Block a user