Skip to content

Commit bcccebf

Browse files
chore: wip
1 parent 257672e commit bcccebf

File tree

3 files changed

+4
-340
lines changed

3 files changed

+4
-340
lines changed

bun.lockb

895 KB
Binary file not shown.

storage/framework/core/queue/src/utils.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
11
import type { JobOptions } from './job'
22
import process from 'node:process'
33
import Job from '../../../orm/src/models/Job'
4+
import { path } from '@stacksjs/path'
45

56
interface QueueOption extends JobOptions {
67
delay: number
78
}
89

910
export async function storeJob(name: string, options: QueueOption): Promise<void> {
11+
const importedJob = (await import(path.appPath(`Jobs/${name}.ts`))).default
12+
1013
const payloadJson = JSON.stringify({
1114
displayName: `app/Jobs/${name}.ts`,
1215
name,
1316
maxTries: options.tries || 1,
1417
timeout: null,
1518
timeoutAt: null,
1619
payload: options.payload || {},
20+
classElements: JSON.stringify(importedJob)
1721
})
1822

1923
const job = {

0 commit comments

Comments
 (0)