Code optimization:change the crawler zip file to slice read

This commit is contained in:
hantmac
2019-08-20 17:09:43 +08:00
parent a599db1810
commit 4446f8704a

View File

@@ -183,7 +183,11 @@ func UploadToGridFs(spider model.Spider, fileName string, filePath string) (fid
}
//分片读取爬虫zip文件
ReadFileByStep(filePath, WriteToGridFS, f)
err = ReadFileByStep(filePath, WriteToGridFS, f)
if err != nil {
debug.PrintStack()
return "", err
}
// 删除zip文件
if err = os.Remove(filePath); err != nil {