context fix
This commit is contained in:
parent
4665c90c2c
commit
c955615fb1
8 changed files with 39 additions and 52 deletions
|
|
@ -11,21 +11,19 @@ import (
|
|||
|
||||
type SurugayaParser struct {
|
||||
scrapper sc.SurugayaScrapperClient
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
func NewSurugayaParser(ctx context.Context, scrapper sc.SurugayaScrapperClient) *SurugayaParser {
|
||||
func NewSurugayaParser(scrapper sc.SurugayaScrapperClient) *SurugayaParser {
|
||||
log.Debug("Surugaya parser init")
|
||||
return &SurugayaParser{
|
||||
scrapper: scrapper,
|
||||
ctx: ctx,
|
||||
}
|
||||
}
|
||||
|
||||
func (s *SurugayaParser) HandleTasks(tasks []shared.Task, sender chan shared.TaskResult, state *appState.State) {
|
||||
func (s *SurugayaParser) HandleTasks(ctx context.Context, tasks []shared.Task, sender chan shared.TaskResult, state *appState.State) {
|
||||
log.WithField("count", len(tasks)).Debug("Handling Surugaya Tasks")
|
||||
|
||||
stream, err := s.scrapper.ProcessTasks(s.ctx)
|
||||
stream, err := s.scrapper.ProcessTasks(ctx)
|
||||
if err != nil {
|
||||
log.WithField("err", err).Error("Error creating stream")
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue