♻️ Refactored process manager
This commit is contained in:
@ -5,7 +5,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
|
||||
"code.smartsheep.studio/goatworks/roadsign/pkg/navi"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/google/uuid"
|
||||
"github.com/samber/lo"
|
||||
@ -17,7 +17,7 @@ func doPublish(c *fiber.Ctx) error {
|
||||
var site *sign.SiteConfig
|
||||
var upstream *sign.UpstreamInstance
|
||||
var process *sign.ProcessInstance
|
||||
for _, item := range sign.App.Sites {
|
||||
for _, item := range navi.App.Sites {
|
||||
if item.ID == c.Params("site") {
|
||||
site = item
|
||||
for _, stream := range item.Upstreams {
|
||||
@ -40,7 +40,7 @@ func doPublish(c *fiber.Ctx) error {
|
||||
|
||||
if upstream == nil && process == nil {
|
||||
return fiber.ErrNotFound
|
||||
} else if upstream != nil && upstream.GetType() != sign.UpstreamTypeFile {
|
||||
} else if upstream != nil && upstream.GetType() != navi.UpstreamTypeFile {
|
||||
return fiber.ErrUnprocessableEntity
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"code.smartsheep.studio/goatworks/roadsign/pkg/navi"
|
||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/samber/lo"
|
||||
@ -31,7 +32,7 @@ func getSiteConfig(c *fiber.Ctx) error {
|
||||
}
|
||||
|
||||
func doSyncSite(c *fiber.Ctx) error {
|
||||
var req sign.SiteConfig
|
||||
var req navi.SiteConfig
|
||||
|
||||
if err := c.BodyParser(&req); err != nil {
|
||||
return err
|
||||
|
@ -1,7 +1,6 @@
|
||||
package sideload
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/goatworks/roadsign/pkg/sign"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
@ -15,7 +14,7 @@ func getStatistics(c *fiber.Ctx) error {
|
||||
})
|
||||
unhealthy := lo.FlatMap(sign.App.Sites, func(item *sign.SiteConfig, idx int) []*sign.ProcessInstance {
|
||||
return lo.Filter(item.Processes, func(item *sign.ProcessInstance, idx int) bool {
|
||||
return item.Status != sign.ProcessStarted
|
||||
return item.Status != navi.ProcessStarted
|
||||
})
|
||||
})
|
||||
|
||||
|
2907
pkg/sideload/view/yarn.lock
Normal file
2907
pkg/sideload/view/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user