x
This commit is contained in:
parent
25841b181f
commit
c7937e7f75
@ -88,22 +88,22 @@ func runTask(task *Task, msgs ...interface{}) string {
|
||||
io.Copy(f, r.Body)
|
||||
f.Close()
|
||||
} else {
|
||||
if path != task.Path && task.Name != task.Path {
|
||||
f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
|
||||
if err != nil {
|
||||
logs.Warn("打开%s失败,", path, err)
|
||||
return ""
|
||||
}
|
||||
f2, err := os.Open(task.Path)
|
||||
if err != nil {
|
||||
f.Close()
|
||||
logs.Warn("打开%s失败,", path, err)
|
||||
return ""
|
||||
}
|
||||
io.Copy(f, f2)
|
||||
f2.Close()
|
||||
f.Close()
|
||||
}
|
||||
// if path != task.Path && task.Name != task.Path {
|
||||
// f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0777)
|
||||
// if err != nil {
|
||||
// logs.Warn("打开%s失败,", path, err)
|
||||
// return ""
|
||||
// }
|
||||
// f2, err := os.Open(task.Path)
|
||||
// if err != nil {
|
||||
// f.Close()
|
||||
// logs.Warn("打开%s失败,", path, err)
|
||||
// return ""
|
||||
// }
|
||||
// io.Copy(f, f2)
|
||||
// f2.Close()
|
||||
// f.Close()
|
||||
// }
|
||||
}
|
||||
lan := Config.Node
|
||||
if strings.Contains(task.Name, ".py") {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user