fix: Prefix the job workflow names with job (#7908)
This commit is contained in:
@@ -5,7 +5,7 @@ export default async function handler(container: MedusaContainer) {
|
||||
}
|
||||
|
||||
export const config = {
|
||||
name: "summarize-orders-job",
|
||||
name: "summarize-orders",
|
||||
schedule: "* * * * * *",
|
||||
numberOfExecutions: 2,
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ describe("register jobs", () => {
|
||||
await registerJobs([
|
||||
{ resolve: path.join(__dirname, "../__fixtures__/plugin") },
|
||||
])
|
||||
const workflow = WorkflowManager.getWorkflow("summarize-orders-job")
|
||||
const workflow = WorkflowManager.getWorkflow("job-summarize-orders")
|
||||
expect(workflow).toBeDefined()
|
||||
expect(workflow?.options.schedule).toEqual({
|
||||
cron: "* * * * * *",
|
||||
|
||||
@@ -45,6 +45,7 @@ export const registerJobs = async (plugins) => {
|
||||
}
|
||||
|
||||
const createJob = async ({ config, handler }) => {
|
||||
const workflowName = `job-${config.name}`
|
||||
const step = createStep(
|
||||
`${config.name}-as-step`,
|
||||
async (stepInput, stepContext) => {
|
||||
@@ -56,7 +57,7 @@ const createJob = async ({ config, handler }) => {
|
||||
|
||||
createWorkflow(
|
||||
{
|
||||
name: config.name,
|
||||
name: workflowName,
|
||||
schedule: {
|
||||
cron: config.schedule,
|
||||
numberOfExecutions: config.numberOfExecutions,
|
||||
|
||||
Reference in New Issue
Block a user