Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cache keygen to service action #1004

Merged
merged 1 commit into from Sep 11, 2021

Conversation

0x0a0d
Copy link
Contributor

@0x0a0d 0x0a0d commented Sep 9, 2021

allow define keygen in action.cache that override cacher.defaultKeygen and cacher.keygen
use case

const serviceSchema = {
  actions: {
    find: {
      cache: {
        keygen(actionName, params, meta, defaultKeys) {
          // add meta.user._id to defaultKeys
          return this.defaultKeygen(actionName, params, meta, ['#user._id'].concat(defaultKeys))
        }
      }
    }
  }
}

@icebob
Copy link
Member

icebob commented Sep 9, 2021

Something is broken in CI test on Node 16. Could you check it?

@0x0a0d
Copy link
Contributor Author

0x0a0d commented Sep 9, 2021

maybe it was a NodeJS bug (v16.9.0), use v16.8.0 will success

@icebob
Copy link
Member

icebob commented Sep 9, 2021

Thanks. I'm checking what is this.

@0x0a0d
Copy link
Contributor Author

0x0a0d commented Sep 11, 2021

fixed in v16.9.1
https://github.com/nodejs/node/releases/tag/v16.9.1

@icebob icebob merged commit 923ef74 into moleculerjs:master Sep 11, 2021
@0x0a0d 0x0a0d mentioned this pull request Oct 28, 2021
@0x0a0d 0x0a0d deleted the service_action_cache_keygen branch March 28, 2022 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants