summaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2018-10-27 22:45:24 +0800
committerGitHub <noreply@github.com>2018-10-27 22:45:24 +0800
commit2b7c366f6489787aecff307732fb3ddfeed1915f (patch)
treebc9de66914ef7076e9cceb0733e1935d0d506e6b /models/issue.go
parent99c09dfbfa818c753459e90db5ff12a323d2936f (diff)
downloadgitea-2b7c366f6489787aecff307732fb3ddfeed1915f.tar.gz
gitea-2b7c366f6489787aecff307732fb3ddfeed1915f.zip
fix sqlite lock (#5184)
* fix sqlite lock * fix bug Co-Authored-By: lunny <xiaolunwen@gmail.com> * fix bug Co-Authored-By: lunny <xiaolunwen@gmail.com>
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/models/issue.go b/models/issue.go
index 8dc0466752..ab4fe3107b 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -655,9 +655,9 @@ func (issue *Issue) changeStatus(e *xorm.Session, doer *User, repo *Repository,
}
// Check for open dependencies
- if isClosed && issue.Repo.IsDependenciesEnabled() {
+ if isClosed && issue.Repo.isDependenciesEnabled(e) {
// only check if dependencies are enabled and we're about to close an issue, otherwise reopening an issue would fail when there are unsatisfied dependencies
- noDeps, err := IssueNoDependenciesLeft(issue)
+ noDeps, err := issueNoDependenciesLeft(e, issue)
if err != nil {
return err
}
@@ -721,6 +721,7 @@ func (issue *Issue) ChangeStatus(doer *User, repo *Repository, isClosed bool) (e
if err = sess.Commit(); err != nil {
return fmt.Errorf("Commit: %v", err)
}
+ sess.Close()
mode, _ := AccessLevel(issue.Poster.ID, issue.Repo)
if issue.IsPull {