Add QueryFunc and remove interface, remove commented code
This commit is contained in:
parent
1e26ed602e
commit
6bf0191492
|
@ -25,12 +25,9 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
type Module interface {
|
||||
Query(Tags, Jobs) ([]Media, error)
|
||||
}
|
||||
|
||||
type Tags []string
|
||||
type Jobs uint
|
||||
type QueryFunc (func(Tags, Jobs) ([]Media, error))
|
||||
|
||||
type Media struct {
|
||||
Source string
|
||||
|
|
|
@ -123,14 +123,8 @@ func Query(tags Tags, j_max Jobs) (mr []Media, err error) {
|
|||
var r_arr []result
|
||||
|
||||
for pid, rpid, ppid := uint(0), uint(0), uint(0); ; {
|
||||
/*
|
||||
if pid <= 200 { // API only allows to fetch up to 200 pages per query
|
||||
*/
|
||||
go run_job(tags, pid, res_chan)
|
||||
pid++
|
||||
/*
|
||||
}
|
||||
*/
|
||||
|
||||
if pid < uint(j_max) {
|
||||
continue
|
||||
|
|
Loading…
Reference in New Issue