From 47e77174a2d17759873d77031829865ae04face6 Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com> Date: Mon, 5 Feb 2024 16:28:20 +0800 Subject: [PATCH] fix:comment out chat.go getLatestVersion Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- internal/msgtransfer/init.go | 17 ++++++------ pkg/common/kafka/consumer_group.go | 4 +-- test/e2e/framework/helpers/chat/chat.go | 36 +++++++++++++------------ 3 files changed, 30 insertions(+), 27 deletions(-) diff --git a/internal/msgtransfer/init.go b/internal/msgtransfer/init.go index 65a6b1935..5ec13fb5a 100644 --- a/internal/msgtransfer/init.go +++ b/internal/msgtransfer/init.go @@ -18,22 +18,18 @@ import ( "context" "errors" "fmt" + "net/http" "os" "os/signal" + "sync" "syscall" "time" - "net/http" - "sync" "github.com/OpenIMSDK/tools/errs" - "github.com/OpenIMSDK/tools/mw" - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/collectors" - "github.com/prometheus/client_golang/prometheus/promhttp" - "google.golang.org/grpc" - "google.golang.org/grpc/credentials/insecure" "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/log" + "github.com/OpenIMSDK/tools/mw" "github.com/openimsdk/open-im-server/v3/pkg/common/config" "github.com/openimsdk/open-im-server/v3/pkg/common/db/cache" "github.com/openimsdk/open-im-server/v3/pkg/common/db/controller" @@ -41,6 +37,11 @@ import ( kdisc "github.com/openimsdk/open-im-server/v3/pkg/common/discoveryregister" "github.com/openimsdk/open-im-server/v3/pkg/common/prommetrics" "github.com/openimsdk/open-im-server/v3/pkg/rpcclient" + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/collectors" + "github.com/prometheus/client_golang/prometheus/promhttp" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" ) type MsgTransfer struct { diff --git a/pkg/common/kafka/consumer_group.go b/pkg/common/kafka/consumer_group.go index 3f444cc1f..22886effe 100644 --- a/pkg/common/kafka/consumer_group.go +++ b/pkg/common/kafka/consumer_group.go @@ -17,11 +17,11 @@ package kafka import ( "context" "errors" - "github.com/IBM/sarama" - "strings" "github.com/OpenIMSDK/tools/errs" "github.com/OpenIMSDK/tools/log" + "github.com/openimsdk/open-im-server/v3/pkg/common/config" + "strings" ) type MConsumerGroup struct { diff --git a/test/e2e/framework/helpers/chat/chat.go b/test/e2e/framework/helpers/chat/chat.go index a4ead528b..cd39a75d8 100644 --- a/test/e2e/framework/helpers/chat/chat.go +++ b/test/e2e/framework/helpers/chat/chat.go @@ -1,4 +1,4 @@ -// Copyright © 2023 OpenIM. All rights reserved. +// Copyright ? 2023 OpenIM. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -99,22 +99,23 @@ func main() { } // getLatestVersion fetches the latest version number from a given URL. -func getLatestVersion(url string) (string, error) { - resp, err := http.Get(url) - if err != nil { - return "", err - } - defer resp.Body.Close() - - location := resp.Header.Get("Location") - if location == "" { - return defaultTemplateVersion, nil - } - - // Extract the version number from the URL - latestVersion := filepath.Base(location) - return latestVersion, nil -} +// 未使用函数 +// func getLatestVersion(url string) (string, error) { +// resp, err := http.Get(url) +// if err != nil { +// return "", err +// } +// defer resp.Body.Close() + +// location := resp.Header.Get("Location") +// if location == "" { +// return defaultTemplateVersion, nil +// } + +// // Extract the version number from the URL +// latestVersion := filepath.Base(location) +// return latestVersion, nil +// } // downloadAndExtract downloads a file from a URL and extracts it to a destination directory. func downloadAndExtract(url, destDir string) error { @@ -164,3 +165,4 @@ func startProcess(cmdPath string) { fmt.Printf("Failed to start process %s: %v\n", cmdPath, err) } } +