()
| 38 | } |
| 39 | |
| 40 | func (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 | |
| 60 | func (p *pluginLoad) UnmarshalYAML(value *yaml.Node) error { |
| 61 |
nothing calls this directly
no test coverage detected