Skip to content

Commit

Permalink
hide timings
Browse files Browse the repository at this point in the history
  • Loading branch information
HaseProgram committed Jan 13, 2018
1 parent fa86efc commit 0f8b460
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions post/post.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func Update(c *routing.Context) (string, int) {
}

func Details(c *routing.Context) (string, int) {
t0 := time.Now()
//t0 := time.Now()
db := database.DB

postID := c.Param("id")
Expand Down Expand Up @@ -252,8 +252,8 @@ func Details(c *routing.Context) (string, int) {
var res common.ErrStruct
res.Message = "Can't found post."
content, _ := json.Marshal(res)
t1 := time.Now();
fmt.Println("Get post details (no post): ", t1.Sub(t0), "404");
//t1 := time.Now();
//fmt.Println("Get post details (no post): ", t1.Sub(t0), "404");
return string(content), 404
case nil:
if _, ok := related["user"]; ok {
Expand All @@ -267,8 +267,8 @@ func Details(c *routing.Context) (string, int) {
var res common.ErrStruct
res.Message = "Can't found post author."
content, _ := json.Marshal(res)
t1 := time.Now();
fmt.Println("Get post details (no author): ", t1.Sub(t0), "404", relatedGet);
//t1 := time.Now();
//fmt.Println("Get post details (no author): ", t1.Sub(t0), "404", relatedGet);
return string(content), 404
case nil:
default:
Expand All @@ -286,8 +286,8 @@ func Details(c *routing.Context) (string, int) {
var res common.ErrStruct
res.Message = "Can't found post forum."
content, _ := json.Marshal(res)
t1 := time.Now();
fmt.Println("Get post details (no forum): ", t1.Sub(t0), "404", relatedGet);
//t1 := time.Now();
//fmt.Println("Get post details (no forum): ", t1.Sub(t0), "404", relatedGet);
return string(content), 404
case nil:
default:
Expand All @@ -304,14 +304,14 @@ func Details(c *routing.Context) (string, int) {
var res common.ErrStruct
res.Message = "Can't found post thread."
content, _ := json.Marshal(res)
t1 := time.Now();
fmt.Println("Get post details (no thread): ", t1.Sub(t0), "404", relatedGet);
//t1 := time.Now();
//fmt.Println("Get post details (no thread): ", t1.Sub(t0), "404", relatedGet);
return string(content), 404
}
}
content, _ := json.Marshal(result)
t1 := time.Now();
fmt.Println("Get post details: ", t1.Sub(t0), "200", relatedGet);
//t1 := time.Now();
//fmt.Println("Get post details: ", t1.Sub(t0), "200", relatedGet);
return string(content), 200
default:
panic(err)
Expand Down Expand Up @@ -421,6 +421,6 @@ func GetPosts(c *routing.Context) (string, int) {
}
content, _ := json.Marshal(res)
t1 := time.Now();
fmt.Println("Get posts: ", t1.Sub(t0), "200", limit, since, sort, desc, threadSlugId, selectStatement);
fmt.Println("Get posts: ", t1.Sub(t0), selectStatement);
return string(content), 200
}

0 comments on commit 0f8b460

Please sign in to comment.