Refactor: use logger = logging.getLogger(__name__) in logging (#24515)
Co-authored-by: Yongtao Huang <99629139+hyongtao-db@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
This commit is contained in:
@@ -75,7 +75,7 @@ class CacheEmbedding(Embeddings):
|
||||
except IntegrityError:
|
||||
db.session.rollback()
|
||||
except Exception:
|
||||
logging.exception("Failed transform embedding")
|
||||
logger.exception("Failed transform embedding")
|
||||
cache_embeddings = []
|
||||
try:
|
||||
for i, n_embedding in zip(embedding_queue_indices, embedding_queue_embeddings):
|
||||
@@ -122,7 +122,7 @@ class CacheEmbedding(Embeddings):
|
||||
raise ValueError("Normalized embedding is nan please try again")
|
||||
except Exception as ex:
|
||||
if dify_config.DEBUG:
|
||||
logging.exception("Failed to embed query text '%s...(%s chars)'", text[:10], len(text))
|
||||
logger.exception("Failed to embed query text '%s...(%s chars)'", text[:10], len(text))
|
||||
raise ex
|
||||
|
||||
try:
|
||||
@@ -136,7 +136,7 @@ class CacheEmbedding(Embeddings):
|
||||
redis_client.setex(embedding_cache_key, 600, encoded_str)
|
||||
except Exception as ex:
|
||||
if dify_config.DEBUG:
|
||||
logging.exception(
|
||||
logger.exception(
|
||||
"Failed to add embedding to redis for the text '%s...(%s chars)'", text[:10], len(text)
|
||||
)
|
||||
raise ex
|
||||
|
Reference in New Issue
Block a user