Skip to content

Commit

Permalink
fix OnPluginStart
Browse files Browse the repository at this point in the history
  • Loading branch information
xuleiming committed Dec 3, 2024
1 parent 7e83f60 commit 6df3456
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bfe_modules/mod_wasmplug/conf_mod_wasmplug.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func updatePluginConf(t *PluginTable, conf PluginConfFile, pluginPath string) er
return err
}

plug.OnPluginStart()
// plug.OnPluginStart()

pluginMapNew[pn] = &plug
}
Expand Down
9 changes: 6 additions & 3 deletions bfe_wasmplug/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ func (w *wasmPluginImpl) EnsureInstanceNum(num int) int {
continue
}

w.OnInstanceStart(instance)
newInstance = append(newInstance, instance)
}

Expand Down Expand Up @@ -311,8 +312,7 @@ func (w *wasmPluginImpl) ReleaseInstance(instance common.WasmInstance) {
atomic.AddInt32(&w.occupy, -1)
}

func (w *wasmPluginImpl) OnPluginStart() {
w.Exec(func(instance common.WasmInstance) bool {
func (w *wasmPluginImpl) OnInstanceStart(instance common.WasmInstance) bool {
abi := wasmABI.GetABIList(instance)[0]
var exports v1Host.Exports
if abi != nil {
Expand Down Expand Up @@ -356,7 +356,10 @@ func (w *wasmPluginImpl) OnPluginStart() {
}

return true
})
}

func (w *wasmPluginImpl) OnPluginStart() {
// w.Exec(w.OnInstanceStart)
}

func (d *wasmPluginImpl) OnPluginDestroy() {}
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ require (
github.com/armon/go-radix v1.0.0
github.com/asergeyev/nradix v0.0.0-20170505151046-3872ab85bb56 // indirect
github.com/baidu/go-lib v0.0.0-20200819072111-21df249f5e6a
github.com/bfenetworks/proxy-wasm-go-host v0.2.1-0.20230626122511-25a9e133320e
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/gomodule/redigo v2.0.0+incompatible
github.com/json-iterator/go v1.1.12
Expand Down Expand Up @@ -40,7 +39,10 @@ require (
gopkg.in/warnings.v0 v0.1.2 // indirect
)

require github.com/go-jose/go-jose/v4 v4.0.4
require (
github.com/bfenetworks/proxy-wasm-go-host v0.0.0-20241202144118-62704e5df808
github.com/go-jose/go-jose/v4 v4.0.4
)

require (
github.com/HdrHistogram/hdrhistogram-go v1.0.1 // indirect
Expand All @@ -67,4 +69,4 @@ require (
howett.net/plist v0.0.0-20181124034731-591f970eefbb // indirect
)

replace github.com/bfenetworks/proxy-wasm-go-host => ../proxy-wasm-go-host
// replace github.com/bfenetworks/proxy-wasm-go-host => ../proxy-wasm-go-host
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuP
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/baidu/go-lib v0.0.0-20200819072111-21df249f5e6a h1:m/u39GNhkoUSC9WxTuM5hWShEqEfVioeXDiqiQd6tKg=
github.com/baidu/go-lib v0.0.0-20200819072111-21df249f5e6a/go.mod h1:FneHDqz3wLeDGdWfRyW4CzBbCwaqesLGIFb09N80/ww=
github.com/bfenetworks/proxy-wasm-go-host v0.0.0-20241202144118-62704e5df808 h1:v0ckUMaZJFe8XvoM9x3kn+lDtMfI9EvpFadiOiV/s8A=
github.com/bfenetworks/proxy-wasm-go-host v0.0.0-20241202144118-62704e5df808/go.mod h1:VG3ZZ8Zg7dYkla2hHy9UsX0GLl/dgJYP4IxuPvoq+/U=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/cucumber/godog v0.8.1 h1:lVb+X41I4YDreE+ibZ50bdXmySxgRviYFgKY6Aw4XE8=
Expand Down

0 comments on commit 6df3456

Please sign in to comment.