# Where should I put the RecurringJob.AddOrUpdate

**URL:** <https://discuss.hangfire.io/t/where-should-i-put-the-recurringjob-addorupdate/288>\
**Category:** question\
**Created:** [October 9, 2014, 8:37pm UTC](https://discuss.hangfire.io/t/where-should-i-put-the-recurringjob-addorupdate/288 "2014-10-09T20:37:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![regisbsbittencourt](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/regisbsbittencourt/32/76_2.png) [@regisbsbittencourt](https://discuss.hangfire.io/u/regisbsbittencourt)\
**Post date:** [October 9, 2014, 8:37pm UTC](https://discuss.hangfire.io/t/where-should-i-put-the-recurringjob-addorupdate/288/1 "2014-10-09T20:37:29Z")

</div>

On all examples there is not a single mention where is the best place to put my RecurringJob.AddOrUpdate.  
Is that the Startup class?

Cheers.

---

<div class="post-metadata">

**Author:** ![Martin\_Bradley](https://avatars.discourse-cdn.com/v4/letter/m/848f3c/32.png) [@Martin\_Bradley](https://discuss.hangfire.io/u/Martin_Bradley)\
**Post date:** [October 23, 2014, 3:43pm UTC](https://discuss.hangfire.io/t/where-should-i-put-the-recurringjob-addorupdate/288/2 "2014-10-23T15:43:29Z")

</div>

Bump. I’d like to know also!

---

<div class="post-metadata">

**Author:** ![vip\_bit](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.hangfire.io/vip_bit/32/78_2.png) [@vip\_bit](https://discuss.hangfire.io/u/vip_bit)\
**Post date:** [November 5, 2014, 4:57pm UTC](https://discuss.hangfire.io/t/where-should-i-put-the-recurringjob-addorupdate/288/3 "2014-11-05T16:57:01Z")

</div>

Startup works fine. but you can also place it in a controller action. whatever fits your needs

---

<div class="post-metadata">

**Author:** ![fouimette](https://avatars.discourse-cdn.com/v4/letter/f/bbce88/32.png) [@fouimette](https://discuss.hangfire.io/u/fouimette)\
**Post date:** [November 11, 2014, 2:51am UTC](https://discuss.hangfire.io/t/where-should-i-put-the-recurringjob-addorupdate/288/4 "2014-11-11T02:51:37Z")

</div>

I called an initialization method from within startup:

```
public partial class Startup
{
    public void Configuration(IAppBuilder app)
    {
        Hangfire.ConfigureHangfire(app);
        Hangfire.InitializeJobs();            
    }
}

```

Here is my HangFire class that I keep in App\_Start:

```
public class Hangfire
{
    public static void ConfigureHangfire(IAppBuilder app)
    {
        app.UseHangfire(config =>
        {
            config.UseSqlServerStorage("HangFireDB");
            config.UseServer();
            config.UseAuthorizationFilters(); //allow all users
        });
    }

    public static void InitializeJobs()
    {
        RecurringJob.AddOrUpdate<HCIAPILib.AccountStatusJob>(j => j.Execute(), "0 23,19 * * *");
        //RecurringJob.AddOrUpdate<HCIAPILib.AccountStatusJob>(j => j.Execute(), "* * * * *");
    }
}
```
