Files
payloadcms/test/queues/tasks/DoNothingTask.ts
Alessio Gravili 3114b89d4c perf: 23% faster job queue system on postgres/sqlite (#13187)
Previously, a single run of the simplest job queue workflow (1 single
task, no db calls by user code in the task - we're just testing db
system overhead) would result in **22 db roundtrips** on drizzle. This
PR reduces it to **17 db roundtrips** by doing the following:

- Modifies db.updateJobs to use the new optimized upsertRow function if
the update is simple
- Do not unnecessarily pass the job log to the final job update when the
workflow completes => allows using the optimized upsertRow function, as
only the main table is involved

---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
  - https://app.asana.com/0/0/1210888186878606
2025-07-30 16:23:43 +03:00

24 lines
459 B
TypeScript

/* eslint-disable @typescript-eslint/require-await */
import type { TaskConfig } from 'payload'
export const DoNothingTask: TaskConfig<'DoNothingTask'> = {
retries: 2,
slug: 'DoNothingTask',
inputSchema: [
{
name: 'message',
type: 'text',
required: true,
},
],
outputSchema: [],
handler: async ({ input }) => {
return {
state: 'succeeded',
output: {
message: input.message,
},
}
},
}