the file processor.js exists in the root folder. Why it is giving this error
``theQ.process('processor.js');```
I appreciate if you can check your code more carefully code before spamming the repo with incomplete issues reports.
I have the same issue:
/projectfolder
-- server.js
-- /functions/CreateRowsByLevelAsset/
-- -- processor.js
-- -- handler.js
In server.js:
queue.process('CreateRowsByLevelAsset', 5, './functions/CreateRowsByLevelAsset/processor.js');
In processor.js
var createRowsByLevelAsset = require('./handler.js');
module.exports = async function(job){
return await createRowsByLevelAsset.handler(job.data);
}
ERROR:
Error: Cannot find module './functions/CreateRowsByLevelAsset/processor.js'
at Function.Module._resolveFilename (module.js:547:15)
at Function.Module._load (module.js:474:25)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at process.<anonymous> (/home/daniel/fintree/assets-scale/node_modules/bull/lib/process/master.js:30:19)
at emitTwo (events.js:126:13)
at process.emit (events.js:214:7)
at emit (internal/child_process.js:772:12)
at _combinedTickCallback (internal/process/next_tick.js:141:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
Please help
Note that I can do this in server.js:
var createRowsByLevelAssetProcessor = require('./functions/CreateRowsByLevelAsset/processor.js');
....
queue.process('CreateRowsByLevelAsset', 5, createRowsByLevelAssetProcessor);
And the queue will work, but the queue is executed in a single core, without taking advantage of the others.
can you try:
queue.process('CreateRowsByLevelAsset', 5, __dirname + '/functions/CreateRowsByLevelAsset/processor.js');
@manast doesn't look so clean but worked, thank you!
Most helpful comment
can you try: