perf: remove timeout

main
zggsong 2 years ago
parent 0f431a7dca
commit f32ba74612

@ -56,7 +56,7 @@ func Login(userName, passwd string) (string, error) {
// @return []string
//
func Upload2Azure(auth string, images map[string]string) ([]string, error) {
var client = &http.Client{Timeout: 10}
var client = &http.Client{}
uploadUrl := "https://p.luxshare-ict.com/api/Azure/TencentFileToAzure"
contentType := "application/x-www-form-urlencoded"
@ -75,11 +75,11 @@ func Upload2Azure(auth string, images map[string]string) ([]string, error) {
request.Header.Set("Authorization", fmt.Sprintf("BaseAuth %v", auth))
resp, err := client.Do(request)
//resp, err := http.Post(uploadUrl, contentType, strings.NewReader(postData.Encode()))
defer resp.Body.Close()
if err != nil {
return nil, errors.New(fmt.Sprintf("[ERROR] (Upload2Azure) Request Error: %v", err))
}
//resp, err := http.Post(uploadUrl, contentType, strings.NewReader(postData.Encode()))
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
var uploadModel model.Upload2AzureResp
@ -98,7 +98,7 @@ func Upload2Azure(auth string, images map[string]string) ([]string, error) {
// @return error
//
func EpidemicRegistration(auth string, images []string) error {
var client = &http.Client{Timeout: 10}
var client = &http.Client{}
uploadUrl := "https://m.luxshare-ict.com/api/EpidemicSys/EpidemicRegistration/LVIQuestSave2"
contentType := "application/x-www-form-urlencoded"
@ -177,7 +177,7 @@ func EpidemicRegistration(auth string, images []string) error {
// @return error
//
func RefreshDoor(auth string) error {
var client = &http.Client{Timeout: 10}
var client = &http.Client{}
refreshUrl := "https://m.luxshare-ict.com/api/EpidemicSys/EpidemicRegistration/RefreshDoor"
request, err := http.NewRequest("POST", refreshUrl, nil)

@ -4,6 +4,7 @@ import (
"bytes"
"encoding/base64"
"fmt"
log "github.com/sirupsen/logrus"
"image"
_ "image/gif"
"image/jpeg"
@ -17,9 +18,6 @@ import (
"net/http"
"os"
"strconv"
"time"
log "github.com/sirupsen/logrus"
)
//
@ -93,7 +91,6 @@ https://github.com/zggsong`))
// @param files
//
func DeclarationService(files map[string]string) {
time.Sleep(3 * time.Second)
//登陆获取auth
//ticket := "Q9okHMY42Fk7kzLA3rvPTCbUShhX3zqlbaT97CDjUbxql0NH0AAqKYw+XfSjwoytijuuHXOc7vNY9GePZoIZSg=="
ticket, err := core.Login(global.GLO_CONFIG.UserName, global.GLO_CONFIG.PassWord)

Loading…
Cancel
Save