diff options
Diffstat (limited to 'cache_commit_path_file_html.go')
-rw-r--r-- | cache_commit_path_file_html.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cache_commit_path_file_html.go b/cache_commit_path_file_html.go new file mode 100644 index 0000000..ec5f67a --- /dev/null +++ b/cache_commit_path_file_html.go @@ -0,0 +1,25 @@ +// SPDX-License-Identifier: AGPL-3.0-only +// SPDX-FileContributor: Runxi Yu <https://runxiyu.org> + +package main + +import ( + "html/template" + + "github.com/dgraph-io/ristretto/v2" + "go.lindenii.runxiyu.org/lindenii-common/clog" +) + +var commitPathFileHTMLCache *ristretto.Cache[[]byte, template.HTML] + +func init() { + var err error + commitPathFileHTMLCache, err = ristretto.NewCache(&ristretto.Config[[]byte, template.HTML]{ + NumCounters: 1e4, + MaxCost: 1 << 60, + BufferItems: 8192, + }) + if err != nil { + clog.Fatal(1, "Error initializing commitPathFileHTMLCache: "+err.Error()) + } +} |