diff options
author | Brecht Van Lommel <brecht@blender.org> | 2025-04-24 21:26:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-24 19:26:57 +0000 |
commit | a9343896f48e2e7e44b6b2d3c38080e134babe04 (patch) | |
tree | 4bd1a1a1f807eccd251d573acee03502db8d4dd6 /models/issues/pull.go | |
parent | d1ad8e1e809aad36e311b1132f5ac996d46f3a66 (diff) | |
download | gitea-a9343896f48e2e7e44b6b2d3c38080e134babe04.tar.gz gitea-a9343896f48e2e7e44b6b2d3c38080e134babe04.zip |
Option to delay conflict checking of old pull requests until page view (#27779)
`[repository.pull-request] DELAY_CHECK_FOR_INACTIVE_DAYS` is a new
setting to delay the mergeable check for pull requests that have been
inactive for the specified number of days.
This avoids potentially long delays for big repositories with many pull
requests. and reduces system load overall when there are many
repositories or pull requests.
When viewing the PR, checking will start immediately and the PR merge
box will automatically reload when complete. Accessing the PR through
the API will also start checking immediately.
The default value of `7` provides a balance between system load, and
keeping behavior similar to what it was before both for users and API
access. With `0` all conflict checking will be delayed, while `-1`
always checks immediately to restore the previous behavior.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'models/issues/pull.go')
-rw-r--r-- | models/issues/pull.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/models/issues/pull.go b/models/issues/pull.go index 016db9f75c..e65b214dab 100644 --- a/models/issues/pull.go +++ b/models/issues/pull.go @@ -10,7 +10,6 @@ import ( "fmt" "io" "regexp" - "strconv" "strings" "code.gitea.io/gitea/models/db" @@ -104,27 +103,6 @@ const ( PullRequestStatusAncestor ) -func (status PullRequestStatus) String() string { - switch status { - case PullRequestStatusConflict: - return "CONFLICT" - case PullRequestStatusChecking: - return "CHECKING" - case PullRequestStatusMergeable: - return "MERGEABLE" - case PullRequestStatusManuallyMerged: - return "MANUALLY_MERGED" - case PullRequestStatusError: - return "ERROR" - case PullRequestStatusEmpty: - return "EMPTY" - case PullRequestStatusAncestor: - return "ANCESTOR" - default: - return strconv.Itoa(int(status)) - } -} - // PullRequestFlow the flow of pull request type PullRequestFlow int |