new get price method
All checks were successful
/ Make image (push) Successful in 38s

This commit is contained in:
nquidox 2026-01-04 15:19:21 +03:00
parent 784a1a74ff
commit ae0a07ae1b
2 changed files with 47 additions and 3 deletions

View file

@ -37,10 +37,12 @@ func (s *Parser) worker(ctx context.Context, receiver chan shared.Task, sender c
for task := range receiver {
log.WithField("task_uuid", task.MerchUuid).Debug(logHeader + logWorker + "processing task")
pageCtx, pageCancel := chromedp.NewContext(ctx, chromedp.WithLogf(func(string, ...any) {}))
//pageCtx, pageCancel := chromedp.NewContext(ctx, chromedp.WithLogf(func(string, ...any) {}))
//
//price, err := s.getPrice(pageCtx, task)
//pageCancel()
price, err := s.getPrice(pageCtx, task)
pageCancel()
price, err := s.getMinimalPrice(task)
if err != nil {
log.WithField("task_uuid", task.MerchUuid).Warn(logHeader + logWorker + logTaskWarning + "failed to process, zero price")
sender <- shared.TaskResult{