# How to change next execution time of recurring jobs - building a carbon aware extension

**URL:** <https://discuss.hangfire.io/t/how-to-change-next-execution-time-of-recurring-jobs-building-a-carbon-aware-extension/9901>\
**Category:** question\
**Tags:** recurring\
**Created:** [April 23, 2023, 5:04pm UTC](https://discuss.hangfire.io/t/how-to-change-next-execution-time-of-recurring-jobs-building-a-carbon-aware-extension/9901 "2023-04-23T17:04:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aydin](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/aydin/32/3288_2.png) [@Aydin](https://discuss.hangfire.io/u/Aydin)\
**Post date:** [April 23, 2023, 5:04pm UTC](https://discuss.hangfire.io/t/how-to-change-next-execution-time-of-recurring-jobs-building-a-carbon-aware-extension/9901/1 "2023-04-23T17:04:35Z")

</div>

Hello community,  
I’m building a carbon aware computing extension for hangfire ([GitHub Repro](https://github.com/bluehands/Hangfire.CarbonAwareExecution)). The idea is to shift the execution time when the power grid is powered by renewables.

What I need is to change the execution time of the job. I could manage this for enqueue & schedule, which is a simple task.

Now, I look forward for a solution to hook to the calculation of next execution time for recurring jobs.

I see the _TryGetNextExecution_ in _RecurringJobEntity_ (_Hangfire.Core_) method which is calaculation the time. It is called from _RecurringJobScheduler:Execute_. But I hav’nt find any extension points to hook into and change the time.

Has anyone an idea how to manage this?

Best regards  
Aydin

---

<div class="post-metadata">

**Author:** ![Aydin](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/aydin/32/3288_2.png) [@Aydin](https://discuss.hangfire.io/u/Aydin)\
**Post date:** [April 29, 2023, 7:45pm UTC](https://discuss.hangfire.io/t/how-to-change-next-execution-time-of-recurring-jobs-building-a-carbon-aware-extension/9901/2 "2023-04-29T19:45:03Z")

</div>

Ok, just get the idea.  
As I see, there is no way to change the execution time of an instance of the recurring job. What I do, is to prevent the execution of that instance by a own version of the IStateMachine. If there is a option for carbon aware computing I schedule the job. For more details see the [https://github.com/bluehands/Hangfire.CarbonAwareExecution](https://github.com/bluehands/Hangfire.CarbonAwareExecution) Project.
