Files
bigcapital/packages/server/src/lib/Plaid/PlaidFetchTransactionsJob.ts
2024-02-02 02:23:49 +02:00

30 lines
525 B
TypeScript

import Container, { Service } from 'typedi';
@Service()
export class PlaidFetchTransactionsJob {
/**
* Constructor method.
*/
constructor(agenda) {
agenda.define(
'plaid-update-account-transactions',
{ priority: 'high', concurrency: 2 },
this.handler
);
}
/**
* Triggers the function.
*/
private handler = async (job, done: Function) => {
const {} = job.attrs.data;
try {
done();
} catch (error) {
console.log(error);
done(error);
}
};
}