MCPcopy Create free account
hub / github.com/QuantumNous/new-api / GetTaskPluginSource

Function GetTaskPluginSource

model/task_plugin.go:247–251  ·  view source on GitHub ↗

GetTaskPluginSource loads one override's JavaScript by row id. Rows never change source in place (SaveTaskPlugin rejects a different source for the same key and version), so the id from a sync snapshot identifies exactly the text whose SourceHash that snapshot reported.

(id int64)

Source from the content-addressed store, hash-verified

245// same key and version), so the id from a sync snapshot identifies exactly the
246// text whose SourceHash that snapshot reported.
247func GetTaskPluginSource(id int64) (LongText, error) {
248 var plugin TaskPlugin
249 err := DB.Select("source").Where(&TaskPlugin{Id: id}).Take(&plugin).Error
250 return plugin.Source, err
251}
252
253func ActivateTaskPlugin(key, version string) error {
254 err := DB.Transaction(func(tx *gorm.DB) error {

Calls

no outgoing calls