id on peer

This commit is contained in:
mr 2024-08-20 12:20:30 +02:00
parent 9e795d795c
commit 8751d36b34
2 changed files with 7 additions and 1 deletions

View File

@ -53,6 +53,9 @@ func (m *MongoDB) Init(collections []string, config MongoConf) {
}
func (m *MongoDB) createClient(MongoURL string) error {
if mngoClient != nil {
return nil
}
var err error
// Allows us to use marshal and unmarshall with results of FindOne() and others
bsonOpts := &options.BSONOptions{

View File

@ -92,7 +92,10 @@ func (wfa *workflowMongoAccessor) book(id string, realData *Workflow, execs []*w
if _, ok := methods[tools.POST]; !ok {
return errors.New("no path found")
}
res, _, _ := wfa.LoadOne(id)
res, code, _ := wfa.LoadOne(id)
if code == 200 {
return errors.New("could not load workflow")
}
r := res.(*Workflow)
g := r.Graph
if realData.Graph != nil {