payload icon indicating copy to clipboard operation
payload copied to clipboard

payload jobs:run - process does not exit

Open andershermansen opened this issue 2 months ago • 0 comments

Describe the Bug

Running

npx payload jobs:run --queue default --limit 10

the process will not exit after checking the queue. It will just hang.

After creating an blank template I just added a simple jobs configuration:

  jobs: {
    tasks: [
      {
        slug: 'example',
        handler: async () => {
          console.log('Example task ran')
          return {
            output: {},
          }
        },
      },
    ]
  }

This is enough to reproduce the issue.

Link to the code that reproduces this issue

https://github.com/andershermansen/payload-test-jobs

Reproduction Steps

  1. Run the jobs with the command npx payload jobs:run --queue default --limit 10

Expected: After running the jobs in the queue the process should exit

Actual: After running the jobs in the queue the process is not exiting

Which area(s) are affected? (Select all that apply)

area: core

Environment Info

Node.js v23.3.0

Binaries:
  Node: 23.3.0
  npm: 10.9.0
  Yarn: N/A
  pnpm: 9.12.3
Relevant Packages:
  payload: 3.5.0
  next: 15.0.4
  @payloadcms/db-mongodb: 3.5.0
  @payloadcms/email-nodemailer: 3.5.0
  @payloadcms/graphql: 3.5.0
  @payloadcms/next/utilities: 3.5.0
  @payloadcms/payload-cloud: 3.5.0
  @payloadcms/richtext-lexical: 3.5.0
  @payloadcms/translations: 3.5.0
  @payloadcms/ui/shared: 3.5.0
  react: 19.0.0
  react-dom: 19.0.0
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:03:15 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T6000
  Available memory (MB): 32768
  Available CPU cores: 10

andershermansen avatar Dec 10 '24 09:12 andershermansen