Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of dashboard #4977

Merged
merged 10 commits into from
Dec 13, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix bugs
  • Loading branch information
lunny committed Nov 30, 2018
commit 1a7e2bd08cf3dd9d09f2739f7e85d18149bf1862
8 changes: 8 additions & 0 deletions models/issue_stopwatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ func CreateOrStopIssueStopwatch(user *User, issue *Issue) error {
if err != nil {
return err
}
if err := issue.loadRepo(x); err != nil {
return err
}

if exists {
// Create tracked time out of the time difference between start date and actual date
timediff := time.Now().Unix() - int64(sw.CreatedUnix)
Expand Down Expand Up @@ -112,6 +116,10 @@ func CancelStopwatch(user *User, issue *Issue) error {
return err
}

if err := issue.loadRepo(x); err != nil {
return err
}

if _, err := CreateComment(&CreateCommentOptions{
Doer: user,
Issue: issue,
Expand Down
3 changes: 3 additions & 0 deletions models/issue_tracked_time.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func AddTime(user *User, issue *Issue, time int64) (*TrackedTime, error) {
if _, err := x.Insert(tt); err != nil {
return nil, err
}
if err := issue.loadRepo(x); err != nil {
return nil, err
}
if _, err := CreateComment(&CreateCommentOptions{
Issue: issue,
Repo: issue.Repo,
Expand Down