Skip to content

Commit

Permalink
feat(next/api): [intelligent operation] sync tickets by raw condition
Browse files Browse the repository at this point in the history
  • Loading branch information
sdjdd committed Dec 5, 2023
1 parent 6e602fb commit 09fc0a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion next/api/src/integration/intelligent-operation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,18 @@ type JobData = {
size?: number;
delay?: number;
dryRun?: boolean;
where?: any;
};

async function processJob(job: Job<JobData>) {
const {
data: { startTime, endTime, size = 50, delay = 1000, dryRun },
data: { startTime, endTime, size = 50, delay = 1000, dryRun, where },
} = job;

const query = Ticket.queryBuilder();
if (where) {
query.setRawCondition(where);
}
query.where('createdAt', '>', new Date(startTime));
if (endTime) {
query.where('createdAt', '<', new Date(endTime));
Expand Down

0 comments on commit 09fc0a8

Please sign in to comment.