Closed falstack closed 3 years ago
依旧是支持的,2.6.x 应该没有对这块做修改。另外我看你的扩展(组件)的用法是比较老的方式,可能随时不兼容,尽量换成新的写法。https://www.yuque.com/midwayjs/midway_v2/component_development
如有问题,可以继续提供简单的可复现 demo。
类似的问题有时候开始会出现,昨天和今天出现了两次,今天出现的一次,我重新用npm run dev竟然好了,所以感觉是ioc容器和数据库连接时机问题。
如果必现的话,可以提供demo..
如果必现的话,可以提供demo..
偶现,还在排查中,怀疑是midwayjs中一些npm包不一致的问题。没有锁版本了,升级到最新版本突然好了在测试服务器机器上面。
如果必现的话,可以提供demo..
偶现,还在排查中,怀疑是midwayjs中一些npm包不一致的问题。没有锁版本了,升级到最新版本突然好了在测试服务器机器上面。
好像找到问题了,我有分布式的任务项目启动就会去使用orm的实体,大概的代码是这样 import { Provide, Inject, Task } from '@midwayjs/decorator'; import { ProjectService } from './project';
@Provide() export class DistributedTaskBuildStatusService { @Inject() projectService: ProjectService;
// 例如下面是每分钟执行一次,并且是分布式任务 @Task({ repeat: { cron: '/10 ' }, // 每十分钟一次 // * // ┬ ┬ ┬ ┬ ┬ ┬ // │ │ │ │ │ | // │ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun) // │ │ │ │ └───── month (1 - 12) // │ │ │ └────────── day of month (1 - 31) // │ │ └─────────────── hour (0 - 23) // │ └──────────────────── minute (0 - 59) // └───────────────────────── second (0 - 59, optional) }) async processStatus() { // StageMean.STAGE_BUILD_BUILD; await this.projectService.processProjectBuildStatus(); console.log('processProjectBuildStatus'); } }
在
@midwayjs/core
的2.5.5
版本中我可以将项目的entity
放到另一个仓库中注入,如:vendor
项目中注入了User
模型sign
项目从vendor
中导入User
在
2.5.5
版本是 work 的,但是升级到2.6.10
就会报错:这是新版本的一个 bug 吗?还是说以后都不再支持这种从第三方包导入模型的方式了?