title: Nestjs cronjob cannot read inject service
body: <p>I set up a cronjob that is supposed to fire and call a service from another module. console logged items are displaying in the console and When I run the method manually from the endpoint. The service returns a successful result. But once I put back the cronjob decorator. The service is undefined</p>
  <p>throwing exception <code>TypeError: Cannot read property 'getAll' of undefined</code></p>
  <p>I have used other nodejs cronjob packages, but the error persists. Is there a workaround?</p>
  <pre><code>@Cron(CronExpression.EVERY_10_SECONDS)
  async test() {
    try {
      console.log('working 22');
      const ee = await this.Service.getAll();
      console.log(ee);
      for (const key in ee) {
        console.log(ee[key].termsID);
      }
      const terms = await this.termsModel.find({
        isDeleted: false
      });
      console.log(terms);
      console.log('working 22 end!');
    } catch (error) {
      console.log(error)
    }
  }
  </code></pre>
  <p>appmodule</p>
  <pre><code>
  @Module({
    imports: [
     TermsModule,
      ScheduleModule.forRoot()
    ],
    controllers: [],
    providers: [],
  })
  export class AppModule { }
  </code></pre>