We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
在 agent.js 中使用 app.createAnonymousContext 方法创建的 ctx 并不完整,没有 service 相关属性。
agent.js
app.createAnonymousContext
ctx
service
// agent.js 'use strict'; module.exports = app => { const ctx = app.createAnonymousContext(); console.log(ctx.service); // undefined };
Steps to reproduce the behavior:
Expected behavior
The text was updated successfully, but these errors were encountered:
agent 目前没有挂载 Service
https://github.com/eggjs/egg/blob/master/lib/loader/agent_worker_loader.js
Sorry, something went wrong.
@atian25 请问一下,多进程模式下,我启动时没法在agent中调用service进行数据插入,但是在app.js中调用service导致同时多个worker同时写入,数据库会报错~比如主键重复,写死锁。我又不想用事务,也不想指定workers=1,请问有什么方法吗
No branches or pull requests
What happens?
在
agent.js
中使用app.createAnonymousContext
方法创建的ctx
并不完整,没有service
相关属性。Mini Showcase Repository(REQUIRED)
How To Reproduce
Steps to reproduce the behavior:
Expected behavior
Context
The text was updated successfully, but these errors were encountered: