From fe4bef4c658f395e0906839055b2bafdcfb7687c Mon Sep 17 00:00:00 2001 From: woytu Date: Thu, 16 Jan 2020 19:44:53 +0800 Subject: [PATCH] =?UTF-8?q?fixed=20=E9=82=AE=E4=BB=B6=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reptile/Netsarang.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reptile/Netsarang.go b/reptile/Netsarang.go index 8b3928f..0e331f0 100644 --- a/reptile/Netsarang.go +++ b/reptile/Netsarang.go @@ -122,17 +122,17 @@ func NetsarangGetInfo(mail, product string) (string, error) { if err != nil { return "", err } - for i := 0; i < 30; { - if mailList != nil || err != nil { + for i := 0; i < 30; i++ { + if len(mailList) > 0 { break } - time.Sleep(1 * time.Minute) + time.Sleep(10 * time.Second) mailList, err = LinShiYouXiangList(prefix) if err != nil { return "", err } } - if len(mailList) == 0 || mailList == nil { + if len(mailList) == 0 { return "", errors.New("没有邮件") } mailbox := mailList[len(mailList)-1]["mailbox"].(string)