Skip to content

Commit

Permalink
fix: lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Feb 23, 2024
1 parent 1f04028 commit 7d3cf5c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
10 changes: 8 additions & 2 deletions node/pkg/admin/adapter/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ func activate(c *fiber.Ctx) error {
panic(err)
}

utils.SendMessage(c, "fetcher", "activate", map[string]any{"id": id})
err = utils.SendMessage(c, "fetcher", "activate", map[string]any{"id": id})
if err != nil {
panic(err)
}

return c.JSON(result)
}
Expand All @@ -133,7 +136,10 @@ func deactivate(c *fiber.Ctx) error {
panic(err)
}

utils.SendMessage(c, "fetcher", "deactivate", map[string]any{"id": id})
err = utils.SendMessage(c, "fetcher", "deactivate", map[string]any{"id": id})
if err != nil {
panic(err)
}

return c.JSON(result)
}
15 changes: 12 additions & 3 deletions node/pkg/admin/fetcher/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@ import (
)

func start(c *fiber.Ctx) error {
utils.SendMessage(c, "fetcher", "start", nil)
err := utils.SendMessage(c, "fetcher", "start", nil)
if err != nil {
panic(err)
}
return c.SendString("fetcher started")
}

func stop(c *fiber.Ctx) error {
utils.SendMessage(c, "fetcher", "stop", nil)
err := utils.SendMessage(c, "fetcher", "stop", nil)
if err != nil {
panic(err)
}
return c.SendString("fetcher stopped")
}

func refresh(c *fiber.Ctx) error {
utils.SendMessage(c, "fetcher", "refresh", nil)
err := utils.SendMessage(c, "fetcher", "refresh", nil)
if err != nil {
panic(err)
}
return c.SendString("fetcher refreshed")
}
8 changes: 7 additions & 1 deletion node/pkg/fetcher/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"bisonai.com/orakl/node/pkg/admin/adapter"
"bisonai.com/orakl/node/pkg/admin/tests"
"bisonai.com/orakl/node/pkg/admin/utils"
"bisonai.com/orakl/node/pkg/bus"
"bisonai.com/orakl/node/pkg/db"
"github.com/gofiber/fiber/v2"
)
Expand Down Expand Up @@ -332,7 +333,12 @@ var sampleData = []string{`{
}`}

func setup() (*fiber.App, error) {
app, err := utils.Setup("")
mb := bus.NewMessageBus()

app, err := utils.Setup(utils.SetupInfo{
Version: "",
Bus: mb,
})
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 7d3cf5c

Please sign in to comment.