12345678910111213141516171819202122232425262728293031323334353637 |
- package services
- import (
- "context"
- "fmt"
- )
- func Task() {
- fmt.Println("start crawler")
- //refreshData := task.NewTask("refreshData", "0 0,30 16-20 * * *", RefreshData)
- //refreshEic := task.NewTask("refreshData", "0 0 1,6 * * *", RefreshEic)
- //task.AddTask("数据爬取", refreshData)
- //task.AddTask("欧洲天然气爬取", refreshEic)
- //task.StartTask()
- FileCoalJsm()
- FileCoalFirm()
- FileCoalCoastal()
- FileCoalInland()
- fmt.Println("end crawler")
- }
- func RefreshData(cont context.Context) (err error) {
- //大连
- SyncRankingFromDalianSearch(0)
- SyncRankingFromZhengzhou()
- SyncRankingFromShangHai()
- SyncRankingFromIne()
- SyncRankingFromCffex()
- //SyncStorageFromEic()
- return
- }
- func RefreshEic(cont context.Context) (err error) {
- SyncStorageFromEic()
- return
- }
|