Add actionlog prereq for compose services
This commit is contained in:
@@ -15,3 +15,7 @@ func (e repositoryError) Error() string {
|
||||
func (e repositoryError) String() string {
|
||||
return "compose.repository." + string(e)
|
||||
}
|
||||
|
||||
func (e repositoryError) Eq(err error) bool {
|
||||
return err != nil && e.Error() == err.Error()
|
||||
}
|
||||
|
||||
@@ -3,6 +3,8 @@ package service
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"github.com/cortezaproject/corteza-server/pkg/actionlog"
|
||||
actionlogRepository "github.com/cortezaproject/corteza-server/pkg/actionlog/repository"
|
||||
"github.com/cortezaproject/corteza-server/pkg/corredor"
|
||||
"time"
|
||||
|
||||
@@ -43,6 +45,8 @@ var (
|
||||
|
||||
DefaultLogger *zap.Logger
|
||||
|
||||
DefaultActionlog actionlog.Recorder
|
||||
|
||||
DefaultSettings settings.Service
|
||||
|
||||
// DefaultPermissions Retrieves & stores permissions
|
||||
@@ -73,6 +77,13 @@ func Initialize(ctx context.Context, log *zap.Logger, c Config) (err error) {
|
||||
|
||||
DefaultLogger = log.Named("service")
|
||||
|
||||
DefaultActionlog = actionlog.NewService(
|
||||
// will log directly to system schema for now
|
||||
actionlogRepository.Mysql(repository.DB(ctx), "sys_actionlog"),
|
||||
log,
|
||||
log,
|
||||
)
|
||||
|
||||
if DefaultPermissions == nil {
|
||||
// Do not override permissions service stored under DefaultPermissions
|
||||
// to allow integration tests to inject own permission service
|
||||
|
||||
Reference in New Issue
Block a user