title: Stop HangFire from running a job multiple times on different servers?
body: <p>I have set up a recurring job that simply processes some orders:</p>
  <pre><code>                    {
                          RecurringJob.AddOrUpdate(
                              hangFireJob.JobId,
                              () =&gt; hangFireJob.Execute(),
                              hangFireJob.Schedule);
                      }
  </code></pre>
  <p>The issue I'm running into, is that we have multiple &quot;backup&quot; servers all running this same code. They all are reaching out to the same HangFire database.</p>
  <p>I'm seeing the same job ran multiple times, which obviously gives us errors since the orders are already processed.</p>
  <p>I want the backup servers to recognize that the recurring job has already been queued and not queue it again.  I figured that it would go off the jobname to do this (the first parameter above). What am I missing here?</p>
  <p>I included the hangfire server setup below:</p>
  <pre><code>        private IEnumerable&lt;IDisposable&gt; GetHangfireServers()
          {
              var configSettings = new Settings();
              GlobalConfiguration.Configuration
                                 .UseNinjectActivator(_kernel)
                                 .SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
                                 .UseSimpleAssemblyNameTypeSerializer()
                                 .UseRecommendedSerializerSettings()
                                 .UseSqlServerStorage(configSettings.HangfireConnectionString, new SqlServerStorageOptions
                                 {
                                     CommandBatchMaxTimeout = TimeSpan.FromMinutes(5),
                                     SlidingInvisibilityTimeout = TimeSpan.FromMinutes(5),
                                     QueuePollInterval = TimeSpan.Zero,
                                     UseRecommendedIsolationLevel = true,
                                     DisableGlobalLocks = false,
                                     SchemaName = &quot;LuxAdapter&quot;,
                                     PrepareSchemaIfNecessary = false
                                 });
  
              yield return new BackgroundJobServer();
          }```
  </code></pre>