feat(task): replace built-in task adaptors with a sandboxed JS plugin system (#7076)

This commit is contained in:
Calcium-Ion
2026-08-29 18:51:57 +08:00
committed by GitHub
parent 7037ac15bd
commit eb48396d5f
336 changed files with 52333 additions and 6369 deletions
+10 -1
View File
@@ -419,6 +419,15 @@ func SearchChannels(keyword string, group string, model string, idSort bool, sor
return channels, nil
}
// GetChannelById loads a channel directly from the database, bypassing the
// in-memory channel cache.
//
// WARNING: do NOT call this on request hot paths (middleware, distribution,
// relay submit/retry, polling). Every call is a synchronous DB query and will
// not see cache-only state. Use CacheGetChannel instead: it serves from the
// in-memory cache and falls back to this function automatically when
// MemoryCacheEnabled is false. Direct use is appropriate only where fresh DB
// state is required, e.g. admin CRUD, channel testing, or cache (re)building.
func GetChannelById(id int, selectAll bool) (*Channel, error) {
channel := &Channel{Id: id}
var err error = nil
@@ -510,7 +519,7 @@ func (channel *Channel) GetBaseURL() string {
}
url := *channel.BaseURL
if url == "" {
url = constant.ChannelBaseURLs[channel.Type]
url = constant.GetChannelBaseURL(channel.Type)
}
return url
}