info log for callback
This commit is contained in:
parent
a15a792130
commit
27ceff60c1
@ -1,7 +1,8 @@
|
|||||||
import logging
|
import logging
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
|
from operator import itemgetter
|
||||||
|
|
||||||
from funcy import rcompose, omit, merge, lmap
|
from funcy import rcompose, omit, merge, lmap, project
|
||||||
|
|
||||||
from pyinfra.config import CONFIG
|
from pyinfra.config import CONFIG
|
||||||
from pyinfra.exceptions import AnalysisFailure
|
from pyinfra.exceptions import AnalysisFailure
|
||||||
@ -17,7 +18,6 @@ from pyinfra.visitor import QueueVisitor
|
|||||||
from pyinfra.visitor.strategies.response.aggregation import AggregationStorageStrategy
|
from pyinfra.visitor.strategies.response.aggregation import AggregationStorageStrategy
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
logger.setLevel(logging.ERROR)
|
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize=None)
|
@lru_cache(maxsize=None)
|
||||||
@ -44,7 +44,15 @@ def get_storage():
|
|||||||
@lru_cache(maxsize=None)
|
@lru_cache(maxsize=None)
|
||||||
def get_callback(analysis_base_url=None):
|
def get_callback(analysis_base_url=None):
|
||||||
analysis_base_url = analysis_base_url or CONFIG.rabbitmq.callback.analysis_endpoint
|
analysis_base_url = analysis_base_url or CONFIG.rabbitmq.callback.analysis_endpoint
|
||||||
return Callback(analysis_base_url)
|
|
||||||
|
callback = Callback(analysis_base_url)
|
||||||
|
|
||||||
|
def wrapped(body):
|
||||||
|
body_repr = project(body, ["dossierId", "fileId", "pages", "images", "operation"])
|
||||||
|
logger.info(f"Processing {body_repr}...")
|
||||||
|
return callback(body)
|
||||||
|
|
||||||
|
return wrapped
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize=None)
|
@lru_cache(maxsize=None)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user