We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 257672e commit bcccebfCopy full SHA for bcccebf
bun.lockb
895 KB
storage/framework/core/queue/src/utils.ts
@@ -1,19 +1,23 @@
1
import type { JobOptions } from './job'
2
import process from 'node:process'
3
import Job from '../../../orm/src/models/Job'
4
+import { path } from '@stacksjs/path'
5
6
interface QueueOption extends JobOptions {
7
delay: number
8
}
9
10
export async function storeJob(name: string, options: QueueOption): Promise<void> {
11
+ const importedJob = (await import(path.appPath(`Jobs/${name}.ts`))).default
12
+
13
const payloadJson = JSON.stringify({
14
displayName: `app/Jobs/${name}.ts`,
15
name,
16
maxTries: options.tries || 1,
17
timeout: null,
18
timeoutAt: null,
19
payload: options.payload || {},
20
+ classElements: JSON.stringify(importedJob)
21
})
22
23
const job = {
0 commit comments