Serialize failures

This commit is contained in:
mr 2024-07-24 09:53:30 +02:00
parent c5f4427f9f
commit 637b2c977d
8 changed files with 7 additions and 11 deletions

View File

@ -3,7 +3,6 @@ package mongo
import ( import (
"context" "context"
"errors" "errors"
"fmt"
"time" "time"
"cloud.o-forge.io/core/oc-lib/dbs" "cloud.o-forge.io/core/oc-lib/dbs"
@ -172,7 +171,6 @@ func (m *MongoDB) UpdateOne(set interface{}, id string, collection_name string)
targetDBCollection := CollectionMap[collection_name] targetDBCollection := CollectionMap[collection_name]
MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second) MngoCtx, cancel = context.WithTimeout(context.Background(), 10*time.Second)
defer cancel() defer cancel()
fmt.Println(doc)
_, err := targetDBCollection.UpdateOne(MngoCtx, filter, dbs.InputToBson(doc, true)) _, err := targetDBCollection.UpdateOne(MngoCtx, filter, dbs.InputToBson(doc, true))
if err != nil { if err != nil {
m.Logger.Error().Msg("Couldn't update resource: " + err.Error()) m.Logger.Error().Msg("Couldn't update resource: " + err.Error())

View File

@ -29,7 +29,7 @@ func (dma *DataResource) Serialize() map[string]interface{} {
if err != nil { if err != nil {
return nil return nil
} }
json.Unmarshal(b, dma) json.Unmarshal(b, &m)
return m return m
} }

View File

@ -51,7 +51,7 @@ func (dma *DatacenterResource) Serialize() map[string]interface{} {
if err != nil { if err != nil {
return nil return nil
} }
json.Unmarshal(b, dma) json.Unmarshal(b, &m)
return m return m
} }

View File

@ -46,7 +46,7 @@ func (dma *ProcessingResource) Serialize() map[string]interface{} {
if err != nil { if err != nil {
return nil return nil
} }
json.Unmarshal(b, dma) json.Unmarshal(b, &m)
return m return m
} }

View File

@ -39,7 +39,7 @@ func (dma *StorageResource) Serialize() map[string]interface{} {
if err != nil { if err != nil {
return nil return nil
} }
json.Unmarshal(b, dma) json.Unmarshal(b, &m)
return m return m
} }

View File

@ -52,6 +52,6 @@ func (dma *WorkflowResource) Serialize() map[string]interface{} {
if err != nil { if err != nil {
return nil return nil
} }
json.Unmarshal(b, dma) json.Unmarshal(b, &m)
return m return m
} }

View File

@ -2,7 +2,6 @@ package oclib
import ( import (
"encoding/json" "encoding/json"
"fmt"
w "cloud.o-forge.io/core/oc-lib/models/resources/workflow" w "cloud.o-forge.io/core/oc-lib/models/resources/workflow"
"cloud.o-forge.io/core/oc-lib/models/utils" "cloud.o-forge.io/core/oc-lib/models/utils"
@ -29,7 +28,6 @@ func (dma *Workflow) Deserialize(j map[string]interface{}) utils.DBObject {
return nil return nil
} }
json.Unmarshal(b, dma) json.Unmarshal(b, dma)
fmt.Println(j, dma)
return dma return dma
} }
@ -39,6 +37,6 @@ func (dma *Workflow) Serialize() map[string]interface{} {
if err != nil { if err != nil {
return nil return nil
} }
json.Unmarshal(b, dma) json.Unmarshal(b, &m)
return m return m
} }

View File

@ -78,6 +78,6 @@ func (dma *WorkflowExecution) Serialize() map[string]interface{} {
if err != nil { if err != nil {
return nil return nil
} }
json.Unmarshal(b, dma) json.Unmarshal(b, &m)
return m return m
} }