Alan Yeung 2 лет назад
Родитель
Сommit
b654527e06
2 измененных файлов с 9 добавлено и 3 удалено
  1. 5 1
      lambda.json
  2. 4 2
      mod/agi/agi.go

+ 5 - 1
lambda.json

@@ -2,5 +2,9 @@
     "uuid1": {
       "username": "admin",
       "path": "user:/test.agi"
-    }
+    },
+    "uuid2": {
+        "username": "admin",
+        "path": "user:/test1.agi"
+      }
   }

+ 4 - 2
mod/agi/agi.go

@@ -269,10 +269,12 @@ func (g *Gateway) ExtAPIHandler(w http.ResponseWriter, r *http.Request) {
 	}
 	scriptContent := string(scriptContentByte)
 
-	log.Println("[Remote AGI] IP:", r.RemoteAddr, " executed the script ", pathFromDb, "(", realPath, ")", " on behalf of", userInfo.Username)
-
 	// execute!
+	start := time.Now()
 	g.ExecuteAGIScript(scriptContent, "", "", w, r, userInfo)
+	duration := time.Since(start)
+
+	log.Println("[Remote AGI] IP:", r.RemoteAddr, " executed the script ", pathFromDb, "(", realPath, ")", " on behalf of", userInfo.Username, "with total duration: ", duration)
 
 }