aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-02-19 19:25:58 +0800
committerGitHub <noreply@github.com>2024-02-19 11:25:58 +0000
commit567a68a0bf78c8d70f08c8ab948fdbb455225aa9 (patch)
tree5a9196473e3ea94403b9f90f15375729beb5bf7b /modules
parent740c6a226c4df26432641018fbfd9186977d573f (diff)
downloadgitea-567a68a0bf78c8d70f08c8ab948fdbb455225aa9.tar.gz
gitea-567a68a0bf78c8d70f08c8ab948fdbb455225aa9.zip
Remove DataRaceCheck (#29258)
Since #26254, it started using `{{ctx.Locale.Tr ...}}` Now the `ctx` seems stable enough, so the check could be removed.
Diffstat (limited to 'modules')
-rw-r--r--modules/context/context_template.go14
1 files changed, 0 insertions, 14 deletions
diff --git a/modules/context/context_template.go b/modules/context/context_template.go
index ba90fc170a..7878d409ca 100644
--- a/modules/context/context_template.go
+++ b/modules/context/context_template.go
@@ -5,10 +5,7 @@ package context
import (
"context"
- "errors"
"time"
-
- "code.gitea.io/gitea/modules/log"
)
var _ context.Context = TemplateContext(nil)
@@ -36,14 +33,3 @@ func (c TemplateContext) Err() error {
func (c TemplateContext) Value(key any) any {
return c.parentContext().Value(key)
}
-
-// DataRaceCheck checks whether the template context function "ctx()" returns the consistent context
-// as the current template's rendering context (request context), to help to find data race issues as early as possible.
-// When the code is proven to be correct and stable, this function should be removed.
-func (c TemplateContext) DataRaceCheck(dataCtx context.Context) (string, error) {
- if c.parentContext() != dataCtx {
- log.Error("TemplateContext.DataRaceCheck: parent context mismatch\n%s", log.Stack(2))
- return "", errors.New("parent context mismatch")
- }
- return "", nil
-}