Why is my Web Job remain running even after it finished the task

91 views Asked by At

I published my web job (trigerred type) in azure and it keep on running after my team add Console.Readline(). it seems the culprit here.

The Job Finished after done it's task and not waiting for the cpu.

1

There are 1 answers

0
AudioBubble On

Please check the below following steps that helps to fix the issue:

  1. Console.ReadLine() should not be present in the Web Job Code.
  2. Recheck the code if there is any infinite loop running which causes this kind of issue.
  3. There are many differences between the Triggered and Continuous Web Job that gives an idea on stopping the Web Jobs. For that information, visit this SO Answer given by @Jay Gong.

I published my web job (trigerred type) in azure

Actually, Web Jobs main aim is of 2 ways either in triggered or Continuous running.

As you didn't give any code snippet, the ideal way is to use the host.Run() for the Triggered Web Jobs and host.Start() for the Continuous Web Jobs Type in the program.cscode file.