Skip to content

Commit

Permalink
Merge pull request #146 from APIParkLab/feature/aibug-fix
Browse files Browse the repository at this point in the history
fix aksk bug
  • Loading branch information
Dot-Liu authored Dec 13, 2024
2 parents 1aca209 + 4c685a9 commit 517007c
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
7 changes: 3 additions & 4 deletions module/application-authorization/auth-driver/aksk/aksk.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package aksk
import (
"encoding/json"
"fmt"

auth_driver "github.com/APIParkLab/APIPark/module/application-authorization/auth-driver"

application_authorization_dto "github.com/APIParkLab/APIPark/module/application-authorization/dto"
)

Expand All @@ -26,8 +26,7 @@ type Config struct {
}

func (a *Config) ID() string {
//TODO implement me
panic("implement me")
return a.Ak
}

func (a *Config) Valid() ([]byte, error) {
Expand Down
24 changes: 1 addition & 23 deletions module/log/iml.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,29 +165,7 @@ func (i *imlLogModule) Get(ctx context.Context, driver string) (*log_dto.LogSour
}

func (i *imlLogModule) OnComplete() {
drivers := log_driver.Drivers()
if len(drivers) < 1 {
return
}
ctx := context.Background()
for _, driver := range drivers {
factory, has := log_driver.GetFactory(driver)
if !has {
log_print.Errorf("driver %s not found", driver)
continue
}
info, err := i.service.GetLogSource(ctx, driver)
if err != nil {
log_print.Errorf("get log source %s error: %s", driver, err)
continue
}
d, _, err := factory.Create(info.Config)
if err != nil {
log_print.Errorf("create driver %s error: %s,config: %s", driver, err, info.Config)
continue
}
log_driver.SetDriver(driver, d)
}

}

func (i *imlLogModule) initGateway(ctx context.Context, clusterId string, clientDriver gateway.IClientDriver) error {
Expand Down
26 changes: 25 additions & 1 deletion service/log/iml.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"errors"
"time"

log_print "github.com/eolinker/eosc/log"

"github.com/google/uuid"

log_driver "github.com/APIParkLab/APIPark/log-driver"
Expand All @@ -25,7 +27,29 @@ type imlLogService struct {
}

func (i *imlLogService) OnComplete() {

drivers := log_driver.Drivers()
if len(drivers) < 1 {
return
}
ctx := context.Background()
for _, driver := range drivers {
factory, has := log_driver.GetFactory(driver)
if !has {
log_print.Errorf("driver %s not found", driver)
continue
}
info, err := i.GetLogSource(ctx, driver)
if err != nil {
log_print.Errorf("get log source %s error: %s", driver, err)
continue
}
d, _, err := factory.Create(info.Config)
if err != nil {
log_print.Errorf("create driver %s error: %s,config: %s", driver, err, info.Config)
continue
}
log_driver.SetDriver(driver, d)
}
}

func (i *imlLogService) UpdateLogSource(ctx context.Context, driver string, input *Save) error {
Expand Down

0 comments on commit 517007c

Please sign in to comment.