fix: Prefix the job workflow names with job (#7908)

This commit is contained in:
Stevche Radevski
2024-07-02 15:13:00 +02:00
committed by GitHub
parent 8244fe03b7
commit e3a0df3ba0
3 changed files with 4 additions and 3 deletions

View File

@@ -5,7 +5,7 @@ export default async function handler(container: MedusaContainer) {
}
export const config = {
name: "summarize-orders-job",
name: "summarize-orders",
schedule: "* * * * * *",
numberOfExecutions: 2,
}

View File

@@ -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: "* * * * * *",

View File

@@ -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,