summaryrefslogtreecommitdiffstats
path: root/models/issue_stopwatch.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-12-13 23:55:43 +0800
committertechknowlogick <hello@techknowlogick.com>2018-12-13 10:55:43 -0500
commitb3b7598ec6846d53d7deb2c84781b06e22c93044 (patch)
tree53c85943b23867b20e2b31742fbe06fcda088ccd /models/issue_stopwatch.go
parent49ea6e0deb7ecef327b0c2f41920f75c6aaf80d3 (diff)
downloadgitea-b3b7598ec6846d53d7deb2c84781b06e22c93044.tar.gz
gitea-b3b7598ec6846d53d7deb2c84781b06e22c93044.zip
Improve performance of dashboard (#4977)
Diffstat (limited to 'models/issue_stopwatch.go')
-rw-r--r--models/issue_stopwatch.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/issue_stopwatch.go b/models/issue_stopwatch.go
index 178b76c5dd..d754e7e19e 100644
--- a/models/issue_stopwatch.go
+++ b/models/issue_stopwatch.go
@@ -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)
@@ -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,