|  | @@ -1,5 +1,4 @@
 | 
											
												
													
														|  |  import logging
 |  |  import logging
 | 
											
												
													
														|  | -import os
 |  | 
 | 
											
												
													
														|  |  import threading
 |  |  import threading
 | 
											
												
													
														|  |  import uuid
 |  |  import uuid
 | 
											
												
													
														|  |  from collections.abc import Generator
 |  |  from collections.abc import Generator
 | 
											
										
											
												
													
														|  | @@ -8,6 +7,7 @@ from typing import Any, Literal, Union, overload
 | 
											
												
													
														|  |  from flask import Flask, current_app
 |  |  from flask import Flask, current_app
 | 
											
												
													
														|  |  from pydantic import ValidationError
 |  |  from pydantic import ValidationError
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +from configs import dify_config
 | 
											
												
													
														|  |  from core.app.app_config.easy_ui_based_app.model_config.converter import ModelConfigConverter
 |  |  from core.app.app_config.easy_ui_based_app.model_config.converter import ModelConfigConverter
 | 
											
												
													
														|  |  from core.app.app_config.features.file_upload.manager import FileUploadConfigManager
 |  |  from core.app.app_config.features.file_upload.manager import FileUploadConfigManager
 | 
											
												
													
														|  |  from core.app.apps.base_app_queue_manager import AppQueueManager, GenerateTaskStoppedError, PublishFrom
 |  |  from core.app.apps.base_app_queue_manager import AppQueueManager, GenerateTaskStoppedError, PublishFrom
 | 
											
										
											
												
													
														|  | @@ -203,7 +203,7 @@ class CompletionAppGenerator(MessageBasedAppGenerator):
 | 
											
												
													
														|  |                  logger.exception("Validation Error when generating")
 |  |                  logger.exception("Validation Error when generating")
 | 
											
												
													
														|  |                  queue_manager.publish_error(e, PublishFrom.APPLICATION_MANAGER)
 |  |                  queue_manager.publish_error(e, PublishFrom.APPLICATION_MANAGER)
 | 
											
												
													
														|  |              except (ValueError, InvokeError) as e:
 |  |              except (ValueError, InvokeError) as e:
 | 
											
												
													
														|  | -                if os.environ.get("DEBUG") and os.environ.get("DEBUG").lower() == "true":
 |  | 
 | 
											
												
													
														|  | 
 |  | +                if dify_config.DEBUG:
 | 
											
												
													
														|  |                      logger.exception("Error when generating")
 |  |                      logger.exception("Error when generating")
 | 
											
												
													
														|  |                  queue_manager.publish_error(e, PublishFrom.APPLICATION_MANAGER)
 |  |                  queue_manager.publish_error(e, PublishFrom.APPLICATION_MANAGER)
 | 
											
												
													
														|  |              except Exception as e:
 |  |              except Exception as e:
 |