#149: Properly fixed app sdk loop issues
This commit is contained in:
@@ -6467,11 +6467,6 @@ func init() {
|
||||
r := mux.NewRouter()
|
||||
r.HandleFunc("/api/v1/_ah/health", healthCheckHandler)
|
||||
|
||||
// Sends an email if the right things are specified
|
||||
r.HandleFunc("/functions/sendmail", handleSendalert).Methods("POST", "OPTIONS")
|
||||
r.HandleFunc("/functions/outlook/register", handleNewOutlookRegister).Methods("GET", "OPTIONS")
|
||||
r.HandleFunc("/functions/outlook/getFolders", handleGetOutlookFolders).Methods("GET", "OPTIONS")
|
||||
|
||||
// Make user related locations
|
||||
r.HandleFunc("/api/v1/users/generateapikey", handleApiGeneration).Methods("GET", "POST", "OPTIONS")
|
||||
r.HandleFunc("/api/v1/users/login", handleLogin).Methods("POST", "OPTIONS")
|
||||
|
||||
@@ -2042,16 +2042,14 @@ func cleanupExecutions(resp http.ResponseWriter, request *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
//if user.Role != "admin" {
|
||||
// resp.WriteHeader(401)
|
||||
// resp.Write([]byte(`{"success": false, "message": "Insufficient permissions"}`))
|
||||
// return
|
||||
//}
|
||||
|
||||
log.Printf("CLEANUP!")
|
||||
log.Printf("%#v", user)
|
||||
if user.Role != "admin" {
|
||||
resp.WriteHeader(401)
|
||||
resp.Write([]byte(`{"success": false, "message": "Insufficient permissions"}`))
|
||||
return
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
// Removes three months from today
|
||||
timestamp := int64(time.Now().AddDate(0, -2, 0).Unix())
|
||||
log.Println(timestamp)
|
||||
@@ -2065,8 +2063,6 @@ func cleanupExecutions(resp http.ResponseWriter, request *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
log.Println(len(workflowExecutions))
|
||||
|
||||
resp.WriteHeader(200)
|
||||
resp.Write([]byte("OK"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user