Closed sooluh closed 5 months ago
And have you started the worker process? node ace queue:listen
?
Actually, I haven't executed it yet, but I want when the server is running to simultaneously run BullMQ as well. I create start/bull.ts
and add it to the preloads in adonisrc.ts
, and the code is as follows,
import net from 'net'
import app from '@adonisjs/core/services/app'
import queue from '@acidiney/bull-queue/services/main'
const PORT = 9999
const server = net.createServer()
server.once('error', async (error: any) => {
if (error.code === 'EADDRINUSE') {
queue.list().forEach(async (queue) => {
await queue.close()
})
}
})
server.once('listening', async () => {
server.close()
// await queue.processBulk(Object.keys(queue.list()))
if (app.inDev) {
await queue.ui(PORT || 9999, Object.keys(queue.list()))
}
})
server.listen(PORT)
Any idea? Perhaps my above code is not quite right.
I'm trying it out, but it's not working. Am I missing any steps?
nace configure ...
adonisrc.ts
already contains@acidiney/bull-queue/queue_provider
in providersnace make:job ...
start/jobs.ts
I want to run the job when opening one of the methods in the controller that has been registered to the route. I call it with the following code:
but it's not working at all. The process inside the
handle()
method doesn't work, even in thefailed()
method.