Add QueryFunc and remove interface, remove commented code

This commit is contained in:
Alex D. 2022-10-11 07:27:39 +00:00
parent 1e26ed602e
commit 6bf0191492
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
2 changed files with 1 additions and 10 deletions

View File

@ -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

View File

@ -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