MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / OnInit

Method OnInit

resources/plugin/plugin-load.go:40–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38}
39
40func (p *pluginLoad) OnInit() {
41
42 p.transaction.Transaction(context.Background(), func(ctx context.Context) error {
43 value, has := p.settingService.Get(ctx, pluginVersionName)
44 if has {
45 if value >= p.version {
46 return nil
47 }
48 }
49 err := p.module.UpdateDefine(ctx, p.defines)
50 if err != nil {
51 return err
52 }
53 return p.settingService.Set(ctx, pluginVersionName, p.version, "system")
54 })
55
56 p.defines = nil
57 p.version = ""
58}
59
60func (p *pluginLoad) UnmarshalYAML(value *yaml.Node) error {
61

Callers

nothing calls this directly

Calls 3

GetMethod · 0.65
UpdateDefineMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected