title: NestJS: Injected dependencies are undefined during cron job execution
body: <p>I cannot get the contextual reference of the <code>MyOtherService</code>.</p>
  
  <p>Following the <a href="https://docs.nestjs.com/techniques/task-scheduling" rel="nofollow noreferrer">docs</a>, this is my code:</p>
  
  <pre><code>@Injectable()
  export class MyService {
      constructor(private readonly myOtherService: MyOtherService) {}
  
      @Cron(CronExpression.EVERY_10_SECONDS)
      async test() {
          this.myOtherService.someMethod()  //myOtherService is undefined;
      }
  }
  </code></pre>