Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backgroundworker-hangfire #22273

Open
1 task done
zhuxingke opened this issue Mar 5, 2025 · 2 comments
Open
1 task done

backgroundworker-hangfire #22273

zhuxingke opened this issue Mar 5, 2025 · 2 comments
Labels

Comments

@zhuxingke
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Description

In the development environment, repeatedly starting the service causes Hangfire initialization to hang, leading to service startup failure. In the Service, I injected the background worker with dependency injection:

Reproduction Steps

No response

Expected behavior

No response

Actual behavior

No response

Regression?

No response

Known Workarounds

No response

Version

9.0.0

User Interface

Common (Default)

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

@zhuxingke zhuxingke added the bug label Mar 5, 2025
@zhuxingke
Copy link
Author

In the Service, I injected the background worker with dependency injection:

await _notificationWorker.StopAsync();

// Modify the scheduled task expression _notificationWorker.CronExpression = Cron.Weekly((System.DayOfWeek)input.Weekly, input.SendTime.Hours, input.SendTime.Minutes);

// Restart the worker await _notificationWorker.StartAsync();
When changing the execution time as above, it works fine the first time, but subsequent attempts result in a StoppingTokenSource error.

@maliming
Copy link
Member

maliming commented Mar 5, 2025

hi

  • Reproduction Steps

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants