Skip to content

Commit

Permalink
Preparration cache for workflows not in use anymore to prevent weird …
Browse files Browse the repository at this point in the history
…caching outliers
  • Loading branch information
frikky committed May 20, 2024
1 parent b68bb27 commit 1ea3f46
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -3658,6 +3658,7 @@ func GetWorkflows(resp http.ResponseWriter, request *http.Request) {
ctx := GetContext(request)
var workflows []Workflow

/*
cacheKey := fmt.Sprintf("%s_workflows", user.ActiveOrg.Id)
cache, err := GetCache(ctx, cacheKey)
if err == nil {
Expand All @@ -3671,6 +3672,7 @@ func GetWorkflows(resp http.ResponseWriter, request *http.Request) {
} else {
//log.Printf("[INFO] Failed getting cache for workflows for user %s", user.Id)
}
*/

workflows, err = GetAllWorkflowsByQuery(ctx, user)
if err != nil {
Expand Down Expand Up @@ -3782,12 +3784,14 @@ func GetWorkflows(resp http.ResponseWriter, request *http.Request) {
return
}

/*
if project.CacheDb {
err = SetCache(ctx, cacheKey, newjson, 30)
if err != nil {
log.Printf("[ERROR] Failed updating workflow cache for org %s: %s", user.ActiveOrg.Id, err)
}
}
*/

resp.WriteHeader(200)
resp.Write(newjson)
Expand Down

0 comments on commit 1ea3f46

Please sign in to comment.