feat: Implement process worker with bullmq
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
b288dc8c35
commit
20e725b590
@@ -2,6 +2,7 @@ import { GraphQLString, GraphQLNonNull } from 'graphql';
|
||||
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
|
||||
import executeFlowType from '../types/execute-flow';
|
||||
import Processor from '../../services/processor';
|
||||
import processorQueue from '../../queues/processor';
|
||||
|
||||
type Params = {
|
||||
stepId: string;
|
||||
@@ -21,6 +22,12 @@ const executeFlowResolver = async (
|
||||
const flow = await step.$relatedQuery('flow');
|
||||
const data = await new Processor(flow, step).run();
|
||||
|
||||
// TODO: Use this snippet to execute flows with the background job.
|
||||
// const data = processorQueue.add('processorJob', {
|
||||
// flowId: flow.id,
|
||||
// stepId: step.id,
|
||||
// });
|
||||
|
||||
await step.$query().patch({
|
||||
status: 'completed',
|
||||
});
|
||||
|
Reference in New Issue
Block a user