Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

queue.process is not running after adding,, #2680

Closed
adhil-bit opened this issue Nov 5, 2023 · 3 comments
Closed

queue.process is not running after adding,, #2680

adhil-bit opened this issue Nov 5, 2023 · 3 comments
Labels

Comments

@adhil-bit
Copy link

adhil-bit commented Nov 5, 2023

i am getting jobId successfully...
but job is not running in queue.process when i am adding log

queue.process(async (job, done) => {
  console.log("running job=====");
  try {
    console.log("job.data: ====", JSON.stringify(job.data));
    const { jobType } = job.data;
    switch (jobType) {
      case "case1": {
    
        }
        // done(); // test
        break;
      }

      case "case2":
        console.log("que running 1");
      
        } catch (error) {
          console.error("Error:", error);
        } finally {
          done(); // Always call the done() function
        }
        break;

      default:
        console.log("Unknown jobType:", jobType);
        done();
        break;
    }
  } catch (error) {
    console.error("Job processing error:", error);
    done(error);
  }

Bull version

updated to new version --> 4.11.4

@manast
Copy link
Member

manast commented Nov 5, 2023

Try this:

queue.process(async (job, done) => {
  console.log("running job=====");
 done();
});

Copy link

stale bot commented Jan 4, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 4, 2024
@adhil-bit
Copy link
Author

Try this:

queue.process(async (job, done) => {
  console.log("running job=====");
 done();
});

hi are suggesting to remove switch case and doing it directly?

@stale stale bot closed this as completed Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants