Skip to content

Commit

Permalink
chore(refactor): move scraper type to a constant
Browse files Browse the repository at this point in the history
Signed-off-by: mudler <[email protected]>
  • Loading branch information
mudler committed Oct 28, 2024
1 parent 5dc9a18 commit f78171a
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 f78171a

Please sign in to comment.