You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a job queue library (ex Adonis Bull)
Create a job with a console log in the handle method
Create an ace command that queues the job inside the handle method
Result: Job will be executed but the command won't end (close it with CTRL+C)
Expected result: job is triggered and command closes correctly.
'use strict'
const {Command} = require('@adonisjs/ace')
const Bull = use('Rocketseat/Bull')
const ImportTagsJob = use('App/Jobs/ImportTagsJob')
const Database = use('Database')
const Redis = use('Redis')
class ImportTags extends Command {
static get signature() {
return 'process:imported-tags'
}
static get description() {
return 'Import nfc and rfid tags from S3'
}
async handle() {
Bull.add(ImportTagsJob.key)
await Database.close()
await Redis.quit()
}
}
module.exports = ImportTags
I also opened an issue on adonis/core (adonisjs/core#2184).
What @thetutlage is saying is that Bull opens their connection to Redis so I have to somehow close that connection and not the one of Adonis Provider.
The text was updated successfully, but these errors were encountered:
Still here. I am using process.exit(0) to close the command while the job was queued but I noticed that each time it does that my db connection is being aborted:
2021-06-16 17:27:05 98 [Warning] Aborted connection 98 to db: 'homestead' user: 'root' host: '172.24.0.1' (Got an error reading communication packets)
Description of bug
Add a job queue library (ex Adonis Bull)
Create a job with a console log in the handle method
Create an ace command that queues the job inside the handle method
Result: Job will be executed but the command won't end (close it with CTRL+C)
Expected result: job is triggered and command closes correctly.
Environment:
"adonis-version": "4.1.0",
node v12.18.2
npm 6.14.10
Additional context
I also opened an issue on adonis/core (adonisjs/core#2184).
What @thetutlage is saying is that Bull opens their connection to Redis so I have to somehow close that connection and not the one of Adonis Provider.
The text was updated successfully, but these errors were encountered: