Craft your forge, Build your project, Grow your community freely
1---
2id: "641d"
3priority: 50
4sprint: ""
5assignee: null
6status: triage
7kind: issue
8---
910# Can call cache
1112In [apex_mermaid](../app/plugins/apex_mermaid/src/main.rs) I was doing:
1314```go
15p :=&Plugin{
16 server: server,
17 canCallCodePlugin: server.CanCallFunc(PLUGIN_CODE, PLUGIN_CODE_FUNC, map[string]string{"code": "", "lang": ""}),
18 canCallMermaidPlugin: server.CanCallFunc(PLUGIN_MERMAID, PLUGIN_MERMAID_FUNC, map[string]string{"code": ""}),
19}
20server.ExportFunc("renderMd", func(args map[string]string) (map[string]string, error) {
21if p.canCallMermaidPlugin {
22...23 }
24}
25```2627But when loading module for conf, there is no right related to project. So server return false. And after that plugin never refresh authorization cache.
2829To fix quickly I do:
3031```go
32p :=&Plugin{
33 server: server,
34}
35server.ExportFunc("renderMd", func(args map[string]string) (map[string]string, error) {
36 p.canCallCodePlugin = server.CanCallFunc(PLUGIN_CODE, PLUGIN_CODE_FUNC, map[string]string{"code": "", "lang": ""})
37 p.canCallMermaidPlugin = server.CanCallFunc(PLUGIN_MERMAID, PLUGIN_MERMAID_FUNC, map[string]string{"code": ""})
38}
39```4041But need to find a proper fix, and a way to explain to future dev that.