Recently, I started using Tsed(newb) and wanted to incorporate the BullMQ plugin into my project.
I needed to run a job immediately after the server starts, but I struggled with implementing it correctly. I referred to this helpful guide here and attempted the following code snippet:
import { JobDispatchService } from "./services/jobDispatchService";
// Code snippet from: https://tsed.io/tutorials/bullmq.html#dispatching-jobs
export class Server {
@Inject()
app: PlatformApplication;
@Inject()
dispatcher: JobDispatchService;
@Configuration()
settings: Configuration;
$beforeRoutesInit(): void {
// Middleware setup
}
$afterRoutesInit(): void {
// Log error message
this.dispatcher.doSomething();
}
}
Upon starting the server, I encountered the following error:
[2023-12-15T01:09:33.035] [DEBUG] [TSED] - Start server...
[Error log details...]
The error message indicated that 'this.injector.getMany' is not recognized as a function. I will need to review my code and investigate further to troubleshoot this issue.