-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Upgrade go dependencies #25819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade go dependencies #25819
Changes from all commits
8e51ba6
9d02f36
0ffa8a9
c818b4d
16aee3c
67f8f9a
f8a46f8
e4ae7c6
36918a8
d48637d
53b9117
279274a
8a20751
7856968
44e2184
766f11c
dc7b05d
3e58c13
0dd3a2f
9e6ae82
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,13 +11,13 @@ import ( | |
"code.gitea.io/gitea/modules/json" | ||
|
||
mc "gitea.com/go-chi/cache" | ||
lru "github.com/hashicorp/golang-lru" | ||
lru "github.com/hashicorp/golang-lru/v2" | ||
) | ||
|
||
// TwoQueueCache represents a LRU 2Q cache adapter implementation | ||
type TwoQueueCache struct { | ||
lock sync.Mutex | ||
cache *lru.TwoQueueCache | ||
cache *lru.TwoQueueCache[string, any] | ||
interval int | ||
} | ||
|
||
|
@@ -146,7 +146,7 @@ func (c *TwoQueueCache) Flush() error { | |
return nil | ||
} | ||
|
||
func (c *TwoQueueCache) checkAndInvalidate(key any) { | ||
func (c *TwoQueueCache) checkAndInvalidate(key string) { | ||
c.lock.Lock() | ||
defer c.lock.Unlock() | ||
cached, ok := c.cache.Peek(key) | ||
|
@@ -155,7 +155,7 @@ func (c *TwoQueueCache) checkAndInvalidate(key any) { | |
} | ||
item, ok := cached.(*MemoryItem) | ||
if !ok || item.hasExpired() { | ||
c.cache.Remove(item) | ||
c.cache.Remove(key) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think |
||
} | ||
} | ||
|
||
|
@@ -187,9 +187,9 @@ func (c *TwoQueueCache) StartAndGC(opts mc.Options) error { | |
GhostRatio: lru.Default2QGhostEntries, | ||
} | ||
_ = json.Unmarshal([]byte(opts.AdapterConfig), cfg) | ||
c.cache, err = lru.New2QParams(cfg.Size, cfg.RecentRatio, cfg.GhostRatio) | ||
c.cache, err = lru.New2QParams[string, any](cfg.Size, cfg.RecentRatio, cfg.GhostRatio) | ||
} else { | ||
c.cache, err = lru.New2Q(size) | ||
c.cache, err = lru.New2Q[string, any](size) | ||
} | ||
c.interval = opts.Interval | ||
if c.interval > 0 { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,7 +51,7 @@ func (Renderer) SanitizerRules() []setting.MarkupSanitizerRule { | |
// Render renders orgmode rawbytes to HTML | ||
func Render(ctx *markup.RenderContext, input io.Reader, output io.Writer) error { | ||
htmlWriter := org.NewHTMLWriter() | ||
htmlWriter.HighlightCodeBlock = func(source, lang string, inline bool) string { | ||
htmlWriter.HighlightCodeBlock = func(source, lang string, inline bool, params map[string]string) string { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The function is changed in niklasfasching/go-org@9b56fc9 |
||
defer func() { | ||
if err := recover(); err != nil { | ||
log.Error("Panic in HighlightCodeBlock: %v\n%s", err, log.Stack(2)) | ||
|
Uh oh!
There was an error while loading. Please reload this page.