Просмотр исходного кода

fix: ping serverless connector

Yeuoly месяцев назад: 6
Родитель
Сommit
51a96959f8
1 измененных файлов с 3 добавлено и 7 удалено
  1. 3 7
      internal/core/plugin_manager/serverless_connector/connector.go

+ 3 - 7
internal/core/plugin_manager/serverless_connector/connector.go

@@ -10,7 +10,6 @@ import (
 	"github.com/langgenius/dify-plugin-daemon/internal/utils/parser"
 	"github.com/langgenius/dify-plugin-daemon/internal/utils/routine"
 	"github.com/langgenius/dify-plugin-daemon/internal/utils/stream"
-	"github.com/langgenius/dify-plugin-daemon/pkg/entities"
 	"github.com/langgenius/dify-plugin-daemon/pkg/entities/plugin_entities"
 )
 
@@ -26,7 +25,7 @@ func Ping() error {
 	if err != nil {
 		return err
 	}
-	response, err := http_requests.PostAndParse[entities.GenericResponse[string]](
+	response, err := http_requests.PostAndParse[string](
 		client,
 		url,
 		http_requests.HttpHeader(map[string]string{
@@ -37,13 +36,10 @@ func Ping() error {
 		return err
 	}
 
-	if response.Code != 0 {
-		return fmt.Errorf("unexpected response from serverless connector: %s", response.Message)
+	if response == nil || *response != "pong" {
+		return fmt.Errorf("unexpected response from serverless connector: %s", *response)
 	}
 
-	if response.Data != "pong" {
-		return fmt.Errorf("unexpected response from serverless connector: %s", response.Data)
-	}
 	return nil
 }