Yeuoly 10 ay önce
ebeveyn
işleme
8971b9864d

+ 1 - 1
internal/core/dify_invocation/http_client.go

@@ -24,7 +24,7 @@ func InitDifyInvocationDaemon(base string, calling_key string) error {
 		Transport: &http.Transport{
 			Dial: (&net.Dialer{
 				Timeout:   5 * time.Second,
-				KeepAlive: 15 * time.Second,
+				KeepAlive: 120 * time.Second,
 			}).Dial,
 			IdleConnTimeout: 120 * time.Second,
 		},

+ 1 - 1
internal/core/plugin_manager/aws_manager/environment.go

@@ -15,7 +15,7 @@ func (r *AWSPluginRuntime) InitEnvironment() error {
 		Transport: &http.Transport{
 			Dial: (&net.Dialer{
 				Timeout:   5 * time.Second,
-				KeepAlive: 15 * time.Second,
+				KeepAlive: 120 * time.Second,
 			}).Dial,
 			IdleConnTimeout: 120 * time.Second,
 		},

+ 2 - 2
internal/core/plugin_manager/serverless/client.go

@@ -26,8 +26,8 @@ func Init(config *app.Config) {
 	client = &http.Client{
 		Transport: &http.Transport{
 			Dial: (&net.Dialer{
-				Timeout:   5 * time.Second,
-				KeepAlive: 15 * time.Second,
+				Timeout:   5 * time.Second,   // how long a http connection can be alive before it's closed
+				KeepAlive: 120 * time.Second, // how long a real tcp connection can be idle before it's closed
 			}).Dial,
 			IdleConnTimeout: 120 * time.Second,
 		},

+ 2 - 2
internal/core/plugin_manager/serverless/connector.go

@@ -118,8 +118,8 @@ func LaunchLambda(identity string, checksum string, context_tar io.Reader) (*str
 		http_requests.HttpHeader(map[string]string{
 			"Authorization": SERVERLESS_CONNECTOR_API_KEY,
 		}),
-		http_requests.HttpReadTimeout(300),
-		http_requests.HttpWriteTimeout(300),
+		http_requests.HttpReadTimeout(240000),
+		http_requests.HttpWriteTimeout(240000),
 		http_requests.HttpPayloadMultipart(
 			map[string]string{
 				"identity": identity,

+ 1 - 1
internal/core/plugin_manager/serverless/packager.go

@@ -109,7 +109,7 @@ func (p *Packager) Pack() (*os.File, error) {
 		if err != nil {
 			return err
 		}
-		tar_header.Name = filename
+		tar_header.Name = full_filename
 
 		// write tar header
 		if err := tar_writer.WriteHeader(tar_header); err != nil {

+ 6 - 1
internal/core/plugin_manager/serverless/packager_test.go

@@ -85,7 +85,7 @@ func TestPackager_Pack(t *testing.T) {
 	dockerfile_found := false
 	requirements_found := false
 	main_py_found := false
-
+	jina_yaml_found := false
 	// Iterate through the files in the tar.gz archive
 	for {
 		header, err := tar_reader.Next()
@@ -103,6 +103,8 @@ func TestPackager_Pack(t *testing.T) {
 			requirements_found = true
 		case "main.py":
 			main_py_found = true
+		case "provider/jina.yaml":
+			jina_yaml_found = true
 		}
 	}
 
@@ -116,4 +118,7 @@ func TestPackager_Pack(t *testing.T) {
 	if !main_py_found {
 		t.Error("main.py not found in the packed archive")
 	}
+	if !jina_yaml_found {
+		t.Error("jina.yaml not found in the packed archive")
+	}
 }