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

Get service from cache first (#1066) #1067

Closed
wants to merge 0 commits into from
Closed

Conversation

fuziye01
Copy link
Contributor

@fuziye01 fuziye01 commented Jun 23, 2021

【issue】: #1066

【特性/模块名称】:缓存优化

【修改内容】:
1.所有查询service的地方都由从db查询修改为先从缓存中查询,如果缓存中没有再查db
根据version版本匹配的地方暂未修改,后续实现了缓存version匹配再修改

2.service缓存key由原来的{serviceID}修改为{domain}/{project}/{serviceID}的形式
否则多域下出现serviceID相同的情况查询会有问题

【自测情况】:
测试通过

@fuziye01 fuziye01 changed the title Get service from cache (#1066) Get service from cache first (#1066) Jun 23, 2021
"go.mongodb.org/mongo-driver/bson"
)

func GetServiceByID(ctx context.Context, serviceID string) (*model.Service, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最早的版本有一层单独访问缓存再查db的逻辑,后来讨论过特地取消的。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前为什么取消

@fuziye01 fuziye01 force-pushed the master branch 5 times, most recently from d030fc0 to 2e8112a Compare June 24, 2021 08:35
@tianxiaoliang
Copy link
Contributor

冲突了

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.

3 participants