Skip to content

collectJobMetadata

function collectJobMetadata(target): CollectedJobMetadata[];

Defined in: tsed/src/utils/collect-job-metadata.ts:60

Collect all job metadata from a class.

ParameterTypeDescription
target(…args) => unknownThe class constructor (decorated with @JobController)

CollectedJobMetadata[]

Array of collected job metadata ready for registration

const metadata = collectJobMetadata(EmailJobs);
// Returns:
// [
//   { fullName: "email.send", method: "sendEmail", opts: {}, isCron: false },
//   { fullName: "email.daily-digest", method: "sendDailyDigest", opts: {}, isCron: true, cronPattern: "0 9 * * *" }
// ]