Skip to content

Commit

Permalink
ADD more timer for deploy method.
Browse files Browse the repository at this point in the history
  • Loading branch information
karminski committed Feb 6, 2024
1 parent 50914f6 commit 054cdde
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/controller/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -760,6 +760,8 @@ func (controller *Controller) ReleaseApp(c *gin.Context) {
if errInGetTeamID != nil || errInGetAPPID != nil || errInGetAuthToken != nil || errInGetUserID != nil {
return
}
performanceTimerEnd0_1 := time.Now().UnixMilli()
fmt.Printf("[timer] phrase 0_1: %d ms\n", -(performanceTimerStart - performanceTimerEnd0_1))

// get request body
req := request.NewReleaseAppRequest()
Expand All @@ -783,6 +785,8 @@ func (controller *Controller) ReleaseApp(c *gin.Context) {
controller.FeedbackBadRequest(c, ERROR_FLAG_ACCESS_DENIED, "you can not access this attribute due to access control policy.")
return
}
performanceTimerEnd0_2 := time.Now().UnixMilli()
fmt.Printf("[timer] phrase 0_2: %d ms\n", -(performanceTimerStart - performanceTimerEnd0_2))

// fetch app
app, errInRetrieveApp := controller.Storage.AppStorage.RetrieveAppByTeamIDAndAppID(teamID, appID)
Expand All @@ -791,6 +795,9 @@ func (controller *Controller) ReleaseApp(c *gin.Context) {
return
}

performanceTimerEnd0_3 := time.Now().UnixMilli()
fmt.Printf("[timer] phrase 0_3: %d ms\n", -(performanceTimerStart - performanceTimerEnd0_3))

// check team can release public app, the free team can not release app as public.
// but when publish app to marketplace, the can re-deploy this app as public.
if req.ExportPublic() && !app.IsPublishedToMarketplace() {
Expand All @@ -810,6 +817,8 @@ func (controller *Controller) ReleaseApp(c *gin.Context) {
return
}
}
performanceTimerEnd0_4 := time.Now().UnixMilli()
fmt.Printf("[timer] phrase 0_4: %d ms\n", -(performanceTimerStart - performanceTimerEnd0_4))

// config app & action public status
if req.ExportPublic() {
Expand All @@ -827,6 +836,9 @@ func (controller *Controller) ReleaseApp(c *gin.Context) {
controller.Storage.ActionStorage.MakeActionPrivateByTeamIDAndAppID(teamID, appID, userID)
}

performanceTimerEnd0_5 := time.Now().UnixMilli()
fmt.Printf("[timer] phrase 0_5: %d ms\n", -(performanceTimerStart - performanceTimerEnd0_5))

// release app version
treeStateLatestVersion, _ := controller.Storage.TreeStateStorage.RetrieveTreeStatesLatestVersion(teamID, appID)
app.SyncMainlineVersionWithTreeStateLatestVersion(treeStateLatestVersion)
Expand Down

0 comments on commit 054cdde

Please sign in to comment.