# Abort a task after a given time

**URL:** <https://discuss.hangfire.io/t/abort-a-task-after-a-given-time/1449>\
**Category:** feature\
**Tags:** queues\
**Created:** [October 21, 2015, 10:16pm UTC](https://discuss.hangfire.io/t/abort-a-task-after-a-given-time/1449 "2015-10-21T22:16:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaxMelcher](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/maxmelcher/32/425_2.png) [@MaxMelcher](https://discuss.hangfire.io/u/MaxMelcher)\
**Post date:** [October 21, 2015, 10:16pm UTC](https://discuss.hangfire.io/t/abort-a-task-after-a-given-time/1449/1 "2015-10-21T22:16:58Z")

</div>

I have a “Halting problem” type of problem - I am not certain if a job will be finished or run just infinitely.  
Is there a elegant way to tell hangfire to kill a task once a configured timeout period is passed? I googled a lot, the closest I found was this one: [https://github.com/HangfireIO/Hangfire/pull/188](https://github.com/HangfireIO/Hangfire/pull/188) - but this only kills a job if it was started too late.

Any pointers?

Thanks!  
Max
