处理AI胡乱生成的乱摊子
This commit is contained in:
@@ -117,6 +117,13 @@ func (a *API) setupRoutes() {
|
||||
}
|
||||
|
||||
// healthHandler 健康检查处理函数
|
||||
// @Summary 健康检查
|
||||
// @Description 检查API服务是否正常运行
|
||||
// @Tags health
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Success 200 {object} map[string]interface{}
|
||||
// @Router /health [get]
|
||||
func (a *API) healthHandler(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
"status": "ok",
|
||||
|
||||
@@ -27,6 +27,9 @@ type Application struct {
|
||||
|
||||
// Config 应用配置
|
||||
Config *config.Config
|
||||
|
||||
// logger 日志组件实例
|
||||
logger *logs.Logger
|
||||
}
|
||||
|
||||
// NewApplication 创建并返回一个新的核心应用实例
|
||||
@@ -50,12 +53,11 @@ func NewApplication(cfg *config.Config) *Application {
|
||||
taskExecutor := task.NewExecutor(5)
|
||||
|
||||
return &Application{
|
||||
Storage: store,
|
||||
Storage: store,
|
||||
API: apiInstance,
|
||||
TaskExecutor: taskExecutor,
|
||||
Config: cfg,
|
||||
logger: logger,
|
||||
logger: logs.NewLogger(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ func (e *Executor) SubmitTask(task Task) {
|
||||
func (e *Executor) worker(id int) {
|
||||
defer e.wg.Done()
|
||||
|
||||
e.logger.Info(fmt.Sprintf("Worker %d started", id))
|
||||
e.logger.Info(fmt.Sprintf("Worker (id = %d) started", id))
|
||||
|
||||
for {
|
||||
select {
|
||||
|
||||
Reference in New Issue
Block a user