mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-12 23:30:35 +00:00
feat(task): replace built-in task adaptors with a sandboxed JS plugin system (#7076)
This commit is contained in:
+10
-1
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user