limit log to debug only
This commit is contained in:
parent
b42b951738
commit
d4c3547791
|
|
@ -3,6 +3,7 @@
|
|||
from common.src.env_settings import EnvironmentSettings
|
||||
from common.src.es_connect import ElasticWrap
|
||||
from common.src.helper import get_duration_str
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
class AggBase:
|
||||
|
|
@ -15,7 +16,10 @@ class AggBase:
|
|||
def get(self):
|
||||
"""make get call"""
|
||||
response, _ = ElasticWrap(self.path).get(self.data)
|
||||
print(f"[agg][{self.name}] took {response.get('took')} ms to process")
|
||||
if settings.DEBUG:
|
||||
print(
|
||||
f"[agg][{self.name}] took {response.get('took')} ms to process"
|
||||
)
|
||||
|
||||
return response.get("aggregations")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue