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

Service 里面怎么拿到context #258

Open
gordanyang opened this issue Nov 18, 2024 · 0 comments
Open

Service 里面怎么拿到context #258

gordanyang opened this issue Nov 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gordanyang
Copy link

gordanyang commented Nov 18, 2024

在此输入你需要反馈的 Bug 具体信息(Bug in Detail):

Service 里面怎么拿到context

@SingletonProto({
// 如果需要在上层使用,需要把 accessLevel 显示声明为 public
accessLevel: AccessLevel.PUBLIC,
})
export class DemoService {
constructor(){
setInterval(() => {
//执行定时任务
// 调用egg-sequelize model更新数据库
ctx.model.Demo.findAll();
}, 100000);
}
}

可复现问题的仓库地址(Reproduction Repo)

https://github.com/ssss

Node 版本号:

v20.14.0

TEgg 版本号:

3.5.2

相关插件名称与版本号:

"egg-sequelize": "^6.0.0",

操作平台与版本号:

macos 15.1

@gordanyang gordanyang added the bug Something isn't working label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant