refactor: use waterflow component in mj, sd and dall image drawing page

This commit is contained in:
RockYang
2024-05-13 19:04:00 +08:00
parent 5fb9f84182
commit 43b6665370
19 changed files with 1118 additions and 759 deletions

View File

@@ -31,7 +31,7 @@ type ServicePool struct {
db *gorm.DB
uploaderManager *oss.UploaderManager
Clients *types.LMap[uint, *types.WsClient] // UserId => Client
licenseService *service.LicenseService
licenseService *service.LicenseService
}
var logger = logger2.GetLogger()
@@ -56,6 +56,7 @@ func (p *ServicePool) InitServices(plusConfigs []types.MjPlusConfig, proxyConfig
for _, s := range p.services {
s.Stop()
}
p.services = make([]*Service, 0)
for k, config := range plusConfigs {
if config.Enabled == false {

View File

@@ -28,7 +28,7 @@ type Service struct {
taskQueue *store.RedisQueue
notifyQueue *store.RedisQueue
db *gorm.DB
running bool
running bool
}
func NewService(name string, taskQueue *store.RedisQueue, notifyQueue *store.RedisQueue, db *gorm.DB, cli Client) *Service {
@@ -38,7 +38,7 @@ func NewService(name string, taskQueue *store.RedisQueue, notifyQueue *store.Red
taskQueue: taskQueue,
notifyQueue: notifyQueue,
Client: cli,
running: true,
running: true,
}
}
@@ -129,7 +129,6 @@ func (s *Service) Run() {
func (s *Service) Stop() {
s.running = false
s.Client = nil
}
type CBReq struct {