zhujy
zhujy
`npx create-react-app create-react-app demo01` 创建少个npx
``` let parts = this.ctx.multipart({ autoFields: true }); ``` 加上`autoFields: true` [参考文档](https://eggjs.org/api/Config.html#multipart)
好的感谢, 我现在选择的的方案是type='worker', 在单个worker上跑定时任务,之后把结果传给其他进程, 我的另外一个问题是, type='all'一般用在什么情景下, 多个worker会存在多个结果
试了curl, 结果还是一样的
schedule/test.js ctx.app赋值ABCD ``` module.exports = { schedule: { interval: "10s", type: "worker", disable: false, immediate: true, }, async task(ctx) { ctx.app.uid='ABCD' console.log('from schedule====>', ctx.app.uid, process.pid) }, }; ``` controller/test.js controller中打印app对象的uid...
本地测试, 加了-c参数 `egg-bin dev --port=8080 --sticky -c=4`
[示例](https://github.com/P3T3R-Z/eggTest.git)
可能我描述的不太准确, 应该是每次打印的process.pid都是一样的
.prevent.stop