# Workers seems to hang and number of active workers slowly descrease to 0

**URL:** <https://discuss.hangfire.io/t/workers-seems-to-hang-and-number-of-active-workers-slowly-descrease-to-0/1207>\
**Category:** question\
**Created:** [August 7, 2015, 10:10am UTC](https://discuss.hangfire.io/t/workers-seems-to-hang-and-number-of-active-workers-slowly-descrease-to-0/1207 "2015-08-07T10:10:53Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![hjm](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/hjm/32/326_2.png) [@hjm](https://discuss.hangfire.io/u/hjm)\
**Post date:** [August 11, 2015, 8:47am UTC](https://discuss.hangfire.io/t/workers-seems-to-hang-and-number-of-active-workers-slowly-descrease-to-0/1207/4 "2015-08-11T08:47:04Z")

</div>

Thanks @odinserj

I’m convinced our own code is the problem and causing the worker to lockup. I was hoping that might be some worker monitoring options to recover stuck workers.

This does make my other question more relevant, do you have recommendations on code that runs when en-queued? If you can make some suggestions?

> [@Best practices or guidelines for code being setup for Hangfire jobs](http://discuss.hangfire.io/t/best-practices-or-guidelines-for-code-being-setup-for-hangfire-jobs/1209):
>
> Are there any best practices around code being queued? Lets say if I have a method like this crashing, would the worker handle the crash and re-queue the job? public void EnqueuedMethod(int someId) { //no exception handling here } If its hangfire scheduled method is internally calling a method which is async, should I configure the awaitable to false? private async Task\<NotificationOutcome\> Send(string json, string[] tags) { return await Hubclient.SendNativeNotificationAsyn…

Thanks in advance!  
hjm

---

_[View the full topic](https://discuss.hangfire.io/t/workers-seems-to-hang-and-number-of-active-workers-slowly-descrease-to-0/1207)._
