HangfireIO / HangfireIO/Hangfire

Duplicate processing hangFire

Open
#2,104 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

I need some help, I'm having problems with simultaneous processing of tasks by different instances.

Follow the code:

private void RegisterRecurringJobs()
{
var environment = ConfigurationManager.AppSettings["Enviroment"];

if (environment == "Live")
{
RecurringJob.AddOrUpdate(
() => GenerateRequestFiscalDocumentMigrate(),
Cron.Daily(2), TimeZoneInfo.FindSystemTimeZoneById("E. South America Standard Time"), "protocol-fiscal-document");

RecurringJob.AddOrUpdate(
() => GetProtocolFiscalDocumentMigrate(),
"*/10 * * * *", TimeZoneInfo.FindSystemTimeZoneById("E. South America Standard Time"), "fiscal-document");

RecurringJob.AddOrUpdate(
() => ImportFiscalDocumentMigrate(),
"*/10 * * * *", TimeZoneInfo.FindSystemTimeZoneById("E. South America Standard Time"), "fiscal-document");

RecurringJob.AddOrUpdate(
() => DesserializeRecurring(),
"0 */2 * * *", TimeZoneInfo.FindSystemTimeZoneById("E. South America Standard Time"), "deserializer");

// RecurringJob.AddOrUpdate(
// () => DesserializeRecurring(),
// "*/5 * * * *", TimeZoneInfo.FindSystemTimeZoneById("E. South America Standard Time"), "deserializer");

RecurringJob.AddOrUpdate(
() => SyncronizeAOSS(),
"0 */2 * * *", TimeZoneInfo.FindSystemTimeZoneById("E. South America Standard Time"), "aoss");

RecurringJob.AddOrUpdate(
() => GenerateFile(),
"*/5 * * * *", TimeZoneInfo.FindSystemTimeZoneById("E. South America Standard Time"), "file-request");

//RecurringJob.AddOrUpdate(
// () => GenerateFile(),
// Cron.Daily(2), TimeZoneInfo.FindSystemTimeZoneById("E. South America Standard Time"), "file-request");

}

}

![image](https://user-images.githubusercontent.com/60444394/195113757-f7c5ecd8-0e8e-433c-a18b-1d275cb22ba8.png)

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the shown RegisterRecurringJobs method and the recurring job identifiers, then reproduce the simultaneous-processing behavior across multiple instances. The issue provides no repository files, tests, or acceptance criteria, so the expected fix and definition of done need clarification.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
15/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.