nil except

This commit is contained in:
mr 2024-08-02 11:04:18 +02:00
parent b125c9be01
commit ed4cb943a8
2 changed files with 5 additions and 3 deletions

View File

@ -103,11 +103,12 @@ func (wfa *workflowMongoAccessor) execute(workflow *Workflow) {
accessor := (&workspace.Workspace{}).GetAccessor()
filters := &dbs.Filters{
Or: map[string]dbs.Filter{
"abstractobject.name": {Operator: dbs.LIKE.String(), Value: workflow.Name + "_workspace"},
"abstractobject.name": {dbs.LIKE.String(), workflow.Name + "_workspace"},
},
}
resource, _, err := accessor.Search(filters, "")
if err == nil && len(resource) == 1 {
fmt.Println(resource)
if err == nil && len(resource) > 0 {
accessor.UpdateOne(&workspace.Workspace{
Active: true,
ResourceSet: resources.ResourceSet{

View File

@ -11,7 +11,8 @@ import (
type Workspace struct {
utils.AbstractObject
resources.ResourceSet
Active bool `json:"active" bson:"active" default:"false"`
IsContextual bool `json:"is_contextual" bson:"is_contextual" default:"false"`
Active bool `json:"active" bson:"active" default:"false"`
}
func (ao *Workspace) GetID() string {