fix:comment out chat.go getLatestVersion

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
pull/1888/head
Xinwei Xiong(cubxxw-openim) 2 years ago
parent 31381935f1
commit 47e77174a2

@ -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 {

@ -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 {

@ -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)
}
}

Loading…
Cancel
Save