mirror of
https://github.com/miniflux/v2.git
synced 2025-07-27 17:28:38 +00:00
Refactor feed creation to allow setting most fields via API
Allow API clients to create disabled feeds or define field like "ignore_http_cache".
This commit is contained in:
parent
ab82c4b300
commit
f0610bdd9c
26 changed files with 370 additions and 264 deletions
|
@ -6,7 +6,7 @@ package worker // import "miniflux.app/worker"
|
|||
|
||||
import (
|
||||
"miniflux.app/model"
|
||||
"miniflux.app/reader/feed"
|
||||
"miniflux.app/storage"
|
||||
)
|
||||
|
||||
// Pool handles a pool of workers.
|
||||
|
@ -22,13 +22,13 @@ func (p *Pool) Push(jobs model.JobList) {
|
|||
}
|
||||
|
||||
// NewPool creates a pool of background workers.
|
||||
func NewPool(feedHandler *feed.Handler, nbWorkers int) *Pool {
|
||||
func NewPool(store *storage.Storage, nbWorkers int) *Pool {
|
||||
workerPool := &Pool{
|
||||
queue: make(chan model.Job),
|
||||
}
|
||||
|
||||
for i := 0; i < nbWorkers; i++ {
|
||||
worker := &Worker{id: i, feedHandler: feedHandler}
|
||||
worker := &Worker{id: i, store: store}
|
||||
go worker.Run(workerPool.queue)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue