Skip to content

Commit 09fc0a8

Browse files
committed
feat(next/api): [intelligent operation] sync tickets by raw condition
1 parent 6e602fb commit 09fc0a8

File tree

1 file changed

+5
-1
lines changed
  • next/api/src/integration/intelligent-operation

1 file changed

+5
-1
lines changed

next/api/src/integration/intelligent-operation/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,14 +167,18 @@ type JobData = {
167167
size?: number;
168168
delay?: number;
169169
dryRun?: boolean;
170+
where?: any;
170171
};
171172

172173
async function processJob(job: Job<JobData>) {
173174
const {
174-
data: { startTime, endTime, size = 50, delay = 1000, dryRun },
175+
data: { startTime, endTime, size = 50, delay = 1000, dryRun, where },
175176
} = job;
176177

177178
const query = Ticket.queryBuilder();
179+
if (where) {
180+
query.setRawCondition(where);
181+
}
178182
query.where('createdAt', '>', new Date(startTime));
179183
if (endTime) {
180184
query.where('createdAt', '<', new Date(endTime));

0 commit comments

Comments
 (0)