# HangFire 0.8.2 released

**URL:** <https://discuss.hangfire.io/t/hangfire-0-8-2-released/26>\
**Category:** releases\
**Created:** [May 21, 2014, 1:10pm UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26 "2014-05-21T13:10:28Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [May 21, 2014, 1:10pm UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/1 "2014-05-21T13:10:28Z")

</div>

Please, see the corresponding [blog post](http://odinserj.net/2014/05/21/hangfire-0.8.2-released/) for the details. Here is the short list of changes:

- **Added** - Batch operations on jobs for HangFire Monitor.
- **Added** - Retry and delete buttons for almost every page of HangFire Monitor.
- **Added** - Duration and latency metrics for succeeded jobs.
- **Added** - Display state transition latencies on job details page.
- **Added** - DisableConcurrentExecution filter.
- **Misc** - Tables in HangFire Monitor received some love.

---

<div class="post-metadata">

**Author:** ![kozalla](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@kozalla](https://discuss.hangfire.io/u/kozalla)\
**Post date:** [May 21, 2014, 1:28pm UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/2 "2014-05-21T13:28:43Z")

</div>

Great job. 😄  
Do you have an idea when the job cancellation will implemented?

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [May 21, 2014, 1:37pm UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/3 "2014-05-21T13:37:04Z")

</div>

What kind of cancellation do you mean? If you don’t want to discard a job, you can [delete it](http://odinserj.net/2014/05/17/hangfire-0.8.1-released/#toc_1). If you have long-running job and want to abort it, you should wait for a while 😄

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [May 21, 2014, 1:40pm UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/4 "2014-05-21T13:40:47Z")

</div>

Hm, no, you can implement abort with yourself, I’ll show you how, if you need it.

---

<div class="post-metadata">

**Author:** ![kozalla](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@kozalla](https://discuss.hangfire.io/u/kozalla)\
**Post date:** [May 21, 2014, 2:35pm UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/5 "2014-05-21T14:35:23Z")

</div>

I need to abort Jobs, yes. If you can show me how that would be great! 😄

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [May 21, 2014, 5:02pm UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/6 "2014-05-21T17:02:54Z")

</div>

I assume your job is using a loop, and you want to break it once a user requested job abort. And I assume that the method has a parameter for identifier of interruptible work. In this case you can add a column, say `Canceled` to your entity and check its value on each iteration. This will add some delays, but it is required to use shared storage here to pass the job cancellation.

The example below uses some kind of EntityFramework, but I forgot all its method names 😄

```auto
public void SendMail(int mailListId)
{
    var mailList = _context.MailLists.Find(mailListId);
    foreach (var email in mailList.Emails)
    {
        // We need to always get the freshest value, not the cached one.
        context.Refresh(RefreshMode.StoreWins, yourEntity);
        if (mailList.Canceled)
        {
            return;
        }
        _service.Send(email);
    }
}

```

To cancel a job, you should set the `Canceled` column value to `true`. If you want to see the job in the `Deleted` state, then just delete it. Otherwise it will be moved to the `Succeeded` state, that can be confusing a bit.

```auto
public void Cancel()
{
    var mailList = _context.MailLists.Find(id);

    BackgroundJob.Delete(mailList.JobId);
    mailList.Canceled = true;

    _context.SaveChanges();
}

```

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [May 22, 2014, 8:54pm UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/7 "2014-05-22T20:54:20Z")

</div>

Mmm? [https://github.com/odinserj/HangFire/pull/103](https://github.com/odinserj/HangFire/pull/103)

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [May 28, 2014, 6:54am UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/8 "2014-05-28T06:54:51Z")

</div>

@kozalla, howdy? You now have a more simple way to cancel jobs, check [HangFire 0.8.3](http://odinserj.net/2014/05/23/hangfire-0.8.3-released/).

---

<div class="post-metadata">

**Author:** ![kozalla](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@kozalla](https://discuss.hangfire.io/u/kozalla)\
**Post date:** [May 28, 2014, 10:15am UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/9 "2014-05-28T10:15:33Z")

</div>

Job cancellation on Hangfire shutdown is exactly the feature I needed!  
Great job! 🙂

---

<div class="post-metadata">

**Author:** ![odinserj](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/odinserj/32/648_2.png) [@odinserj](https://discuss.hangfire.io/u/odinserj)\
**Post date:** [May 28, 2014, 10:39am UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/10 "2014-05-28T10:39:46Z")

</div>

Thanks. What problems have you encountered without cancellation on shutdown? Long application shutdown time, 30-minute latency after application restart due to InvisibilityTimeout or both?

---

<div class="post-metadata">

**Author:** ![kozalla](https://avatars.discourse-cdn.com/v4/letter/k/a8b319/32.png) [@kozalla](https://discuss.hangfire.io/u/kozalla)\
**Post date:** [May 28, 2014, 1:17pm UTC](https://discuss.hangfire.io/t/hangfire-0-8-2-released/26/11 "2014-05-28T13:17:37Z")

</div>

If I have to deploy a new version and the database context will change while a job is running I will run in to Problems. And it would be very uncomfortable to wait until the jobs have completed 😄
