Rocketseat / adonis-bull

The easiest way to start using an asynchronous job queue with AdonisJS. Ready for Adonis v5 ⚡️
MIT License
310 stars 57 forks source link

v5 job file malformed #122

Open Venipa opened 2 years ago

Venipa commented 2 years ago

Description of bug Unable to start adonis with bullmq, "Invalid or unexpected token"

To Reproduce

Steps to reproduce the behavior:

  1. Create jobs
  2. listen for queue
  3. after a few days (for me) it threw that error

image

Expected behavior

job.js not getting malformed

Exception or Error


{"type":"SyntaxError","message":"Invalid or unexpected token","stack":"/var/www/maplefiles/node_modules/bullmq/dist/cjs/classes/job.js:1\n\n\n\nSyntaxError: Invalid or unexpected token\n    at Object.compileFunction (node:vm:360:18)\n    at wrapSafe (node:internal/modules/cjs/loader:1055:15)\n    at Module._compile (node:internal/modules/cjs/loader:1090:27)\n    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)\n    at Module.load (node:internal/modules/cjs/loader:1004:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:839:12)\n    at Module.require (node:internal/modules/cjs/loader:1028:19)\n    at Module.Hook._require.Module.require (/usr/local/share/.config/yarn/global/node_modules/require-in-the-middle/index.js:101:39)\n    at require (node:internal/modules/cjs/helpers:102:18)\n    at Object. (/var/www/maplefiles/node_modules/bullmq/src/classes/queue-base.ts:5:1)

Screenshots

image

Environment:

Venipa commented 2 years ago

could it be that Job.discard() is causing this?