mirror of
https://github.com/terorie/od-database-crawler.git
synced 2025-04-18 01:46:43 +00:00
Save: queue dir if not yet exists
This commit is contained in:
parent
c6d7fad8e8
commit
fe1e7bf261
10
resume.go
10
resume.go
@ -73,9 +73,13 @@ func ResumeTasks() (tasks []*OD, err error) {
|
||||
}
|
||||
|
||||
func SaveTask(od *OD) (err error) {
|
||||
fPath := filepath.Join("queue",
|
||||
strconv.FormatUint(od.Task.WebsiteId, 10),
|
||||
"PAUSED")
|
||||
dir := filepath.Join("queue",
|
||||
strconv.FormatUint(od.Task.WebsiteId, 10))
|
||||
|
||||
fPath := filepath.Join(dir, "PAUSED")
|
||||
|
||||
err = os.Mkdir(dir, 0777)
|
||||
if err != nil { return err }
|
||||
|
||||
pausedF, err := os.OpenFile(fPath, os.O_CREATE | os.O_WRONLY | os.O_TRUNC, 0666)
|
||||
if err != nil { return err }
|
||||
|
Loading…
x
Reference in New Issue
Block a user