fixed issue with app sdk not loading full execution properly for /api/v1/run actions
This commit is contained in:
@@ -1767,27 +1767,12 @@ class AppBase:
|
||||
self.send_result(self.action_result, headers, stream_path)
|
||||
return
|
||||
|
||||
|
||||
# Add async logger
|
||||
# self.console_logger.handlers[0].stream.set_execution_id()
|
||||
|
||||
# FIXME: Shouldn't skip this, but it's good for minimzing API calls
|
||||
#try:
|
||||
# ret = requests.post("%s%s" % (self.base_url, stream_path), headers=headers, json=action_result, verify=False)
|
||||
# self.logger.info("Workflow: %d" % ret.status_code)
|
||||
# if ret.status_code != 200:
|
||||
# self.logger.info(ret.text)
|
||||
#except requests.exceptions.ConnectionError as e:
|
||||
# self.logger.info("Connectionerror: %s" % e)
|
||||
|
||||
# action_result["result"] = "Bad setup during startup: %s" % e
|
||||
# self.send_result(action_result, headers, stream_path)
|
||||
# return
|
||||
|
||||
# Verify whether there are any parameters with ACTION_RESULT required
|
||||
# If found, we get the full results list from backend
|
||||
|
||||
# Forcing this to run due to potential self.full_execution loading issues in cloud run
|
||||
fullexecution = {}
|
||||
if isinstance(self.full_execution, str) and len(self.full_execution) == 0:
|
||||
if True or (isinstance(self.full_execution, str) and len(self.full_execution) == 0):
|
||||
#self.logger.info("[DEBUG] NO EXECUTION - LOADING!")
|
||||
try:
|
||||
failed = False
|
||||
|
||||
@@ -497,6 +497,7 @@ func createNewUser(username, password, role, apikey string, org shuffle.OrgMini)
|
||||
newUser.ActiveOrg = shuffle.OrgMini{
|
||||
Id: org.Id,
|
||||
Name: org.Name,
|
||||
Role: newUser.Role,
|
||||
}
|
||||
|
||||
if len(apikey) > 0 {
|
||||
@@ -934,10 +935,22 @@ func handleInfo(resp http.ResponseWriter, request *http.Request) {
|
||||
|
||||
//if err == nil {
|
||||
if len(org.Id) > 0 {
|
||||
if userInfo.Role == "" {
|
||||
//err = shuffle.SetUser(ctx, &userInfo, false)
|
||||
for _, user := range org.Users {
|
||||
if user.Id != userInfo.Id {
|
||||
continue
|
||||
}
|
||||
|
||||
userInfo.ActiveOrg.Role = user.Role
|
||||
}
|
||||
}
|
||||
|
||||
userInfo.ActiveOrg = shuffle.OrgMini{
|
||||
Id: org.Id,
|
||||
Name: org.Name,
|
||||
CreatorOrg: org.CreatorOrg,
|
||||
ChildOrgs: org.ChildOrgs,
|
||||
Role: userInfo.ActiveOrg.Role,
|
||||
Image: org.Image,
|
||||
}
|
||||
@@ -5219,6 +5232,7 @@ func initHandlers() {
|
||||
r.HandleFunc("/api/v1/orgs/{orgId}/delete_cache", shuffle.HandleDeleteCacheKeyPost).Methods("POST", "OPTIONS")
|
||||
r.HandleFunc("/api/v1/orgs/{orgId}/cache/{cache_key}", shuffle.HandleDeleteCacheKey).Methods("DELETE", "OPTIONS")
|
||||
r.HandleFunc("/api/v1/orgs/{orgId}/stats", shuffle.HandleGetStatistics).Methods("GET", "OPTIONS")
|
||||
r.HandleFunc("/api/v1/orgs/{orgId}/stats", shuffle.HandleAppendStatistics).Methods("POST", "OPTIONS")
|
||||
r.HandleFunc("/api/v1/orgs/{orgId}/statistics", shuffle.HandleGetStatistics).Methods("GET", "OPTIONS")
|
||||
|
||||
r.HandleFunc("/api/v1/orgs/{orgId}/cache", shuffle.HandleListCacheKeys).Methods("GET", "OPTIONS")
|
||||
|
||||
Reference in New Issue
Block a user