未验证 提交 60761836 编写于 作者: O omi 提交者: GitHub

skip validating when importing from remote (#185)

上级 075bfde9
......@@ -3,6 +3,7 @@ package common
import (
"encoding/json"
"github.com/appbaseio/abc/log"
"net/url"
"os"
"os/exec"
"runtime"
......@@ -91,6 +92,12 @@ func SizeInKB(size int) int {
// IsFileValid check if the file is valid
func IsFileValid(file string) error {
if _, err := url.ParseRequestURI(file); err == nil { //do not check remote file validity here
log.Infoln("Importing data from remote file", file)
return nil
}
if _, err := os.Stat(file); os.IsNotExist(err) {
return err
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册