Skip to content

Commit

Permalink
Merge pull request #2 from masa-finance/chore/refactor_scraper
Browse files Browse the repository at this point in the history
chore(refactor): move scraper type to a constant
  • Loading branch information
mudler authored Oct 28, 2024
2 parents 5dc9a18 + f78171a commit c31771b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions internal/jobs/webscraper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import (
"github.com/masa-finance/tee-worker/api/types"
)

const WebScraperType = "web-scraper"

type WebScraper struct {
}

Expand Down
4 changes: 2 additions & 2 deletions internal/jobserver/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ type worker interface {
func (js *JobServer) doWork(j types.Job) error {
var w worker
switch j.Type {
case "web-scraper":
w = &jobs.WebScraper{}
case jobs.WebScraperType:
w = jobs.NewWebScraper()
default:
js.Lock()
js.results[j.UUID] = types.JobResult{
Expand Down

0 comments on commit c31771b

Please sign in to comment.