chore: fix lint issues and improve formatting
This commit is contained in:
@@ -133,9 +133,14 @@ func FilterInstGoJa(gl core.Params) (core.FilterInstance, error) {
|
|||||||
}
|
}
|
||||||
if result != nil {
|
if result != nil {
|
||||||
if _, ok := result.Export().(*goja.Promise); ok {
|
if _, ok := result.Export().(*goja.Promise); ok {
|
||||||
vm.Set("__internal_resolve", func(goja.Value) { stop <- nil })
|
if err := errors.Join(
|
||||||
vm.Set("__internal_reject", func(reason goja.Value) { stop <- errors.New(reason.String()) })
|
vm.Set("__internal_resolve", func(goja.Value) { stop <- nil }),
|
||||||
vm.Set("__internal_promise", result)
|
vm.Set("__internal_reject", func(reason goja.Value) { stop <- errors.New(reason.String()) }),
|
||||||
|
vm.Set("__internal_promise", result),
|
||||||
|
); err != nil {
|
||||||
|
stop <- err
|
||||||
|
return
|
||||||
|
}
|
||||||
_, err := vm.RunString(`__internal_promise.then(__internal_resolve).catch(__internal_reject)`)
|
_, err := vm.RunString(`__internal_promise.then(__internal_resolve).catch(__internal_reject)`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
stop <- err
|
stop <- err
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ func WithEvent(event subscribe.Subscriber) ServerOption {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func WithMetaCache(cache kv.KV, ttl time.Duration, refresh time.Duration, refreshConcurrent int) ServerOption {
|
func WithMetaCache(cache kv.KV, ttl, refresh time.Duration, refreshConcurrent int) ServerOption {
|
||||||
return func(c *serverConfig) {
|
return func(c *serverConfig) {
|
||||||
c.cacheMeta = cache
|
c.cacheMeta = cache
|
||||||
c.cacheMetaTTL = ttl
|
c.cacheMetaTTL = ttl
|
||||||
|
|||||||
Reference in New Issue
Block a user