nest-schedule
nest-schedule copied to clipboard
Issues with injecting other services
Hello, first of all, this is a very nice module;
I've been using scheduler service in such way:
@Injectable()
export class ScheduleService extends NestSchedule {
constructor(
@InjectModel("Subscription") private readonly Subscription: Model<ISubscriptionInstance>,
@Inject("NotificationService") private readonly notificationService: NotificationService
) {
super();
}
@Interval(config.scheduleInterval, {
immediate: true
})
async intervalJob() {
// ...
}
}
I've been able to successfully inject models, but I am unable to inject other service, as I am getting this error:
Nest can't resolve dependencies of the NotificationService (?). Please make sure that the argument at index [0] is available in the NotificationService context.
Is that limitation of the lib or I am doing something wrong? I've been able to inject services in other modules just fine.
Please check NotificationService constructor index[0] parameter, nest inject it fail