Hello Team,
we are implementing a long running jobs on Heroku following this project: GitHub - heroku-examples/node-workers-example: A simple example of using Redis to coordinate a worker process
as the worker.js runs on a different dyno now there is a question how we can handle an authenticated request call to the host JIRA
usually we do use this construction in our application:
var httpClient = addon.httpClient(req);
httpClient.get('/', function(err, res, body) {
...
});
and in the ideal scenario we would need something like this:
const reqData = stringify(req);
const addonData = stringify(addon);
let job = await workQueue.add({reqData, addonData})
so we could access the host Jira within the job process easily, but since these objects are not serializable (converting circular structure to JSON), we are not sure how to do it the right way. Is there a simple way how we can access the host JIRA within je job process?