简体   繁体   中英

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

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.

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.cs code file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM