diff --git a/models/live/live_mongo_accessor.go b/models/live/live_mongo_accessor.go index 6100bac..e7eb266 100644 --- a/models/live/live_mongo_accessor.go +++ b/models/live/live_mongo_accessor.go @@ -9,13 +9,13 @@ import ( "cloud.o-forge.io/core/oc-lib/tools" ) -type computeUnitsMongoAccessor[T LiveInterface] struct { +type liveMongoAccessor[T LiveInterface] struct { utils.AbstractAccessor[LiveInterface] // AbstractAccessor contains the basic fields of an accessor (model, caller) } // New creates a new instance of the computeUnitsMongoAccessor -func NewAccessor[T LiveInterface](t tools.DataType, request *tools.APIRequest) *computeUnitsMongoAccessor[T] { - return &computeUnitsMongoAccessor[T]{ +func NewAccessor[T LiveInterface](t tools.DataType, request *tools.APIRequest) *liveMongoAccessor[T] { + return &liveMongoAccessor[T]{ AbstractAccessor: utils.AbstractAccessor[LiveInterface]{ Logger: logs.CreateLogger(t.String()), // Create a logger with the data type Request: request, @@ -36,7 +36,7 @@ func NewAccessor[T LiveInterface](t tools.DataType, request *tools.APIRequest) * /* * Nothing special here, just the basic CRUD operations */ -func (a *computeUnitsMongoAccessor[T]) CopyOne(data utils.DBObject) (utils.DBObject, int, error) { +func (a *liveMongoAccessor[T]) CopyOne(data utils.DBObject) (utils.DBObject, int, error) { // is a publisher... that become a resources. if data.IsDrafted() { return nil, 422, errors.New("can't publish a drafted compute units") diff --git a/models/workflow/workflow.go b/models/workflow/workflow.go index e18fb8d..fdaa165 100644 --- a/models/workflow/workflow.go +++ b/models/workflow/workflow.go @@ -207,7 +207,8 @@ func (d *Workflow) generateResource(datas []resources.ResourceInterface, request json.Unmarshal(b, &liv) data, _, err := access.StoreOne(&liv) if err == nil { - access.CopyOne(data) + _, _, err := access.CopyOne(data) + fmt.Println("COPY ", err) } } continue @@ -218,7 +219,8 @@ func (d *Workflow) generateResource(datas []resources.ResourceInterface, request json.Unmarshal(b, &liv) data, _, err := access.StoreOne(&liv) if err == nil { - access.CopyOne(data) + _, _, err := access.CopyOne(data) + fmt.Println("COPY ", err) } } continue