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

After updating my Blazor solution to Xpand.XAF.All 4.242.4 and .NET 9.0, the Hangfire jobs stopped working #1084

Open
ricardoamm opened this issue Jan 8, 2025 · 26 comments
Assignees
Labels
Bug JobScheduler Reactive.XAF eXpandFrameowrk/DevExpress.XAF project

Comments

@ricardoamm
Copy link

The Trigger and Pause buttons in the Job Detail view do nothing.

@ricardoamm ricardoamm added Bug Reactive.XAF eXpandFrameowrk/DevExpress.XAF project labels Jan 8, 2025
@apobekiaris
Copy link
Member

did you tried the minor from #1083 my guess is it relates

@ricardoamm
Copy link
Author

The problem remains.
I update the Hangfire Version, and now i'm getting:

System.TypeLoadException: 'Could not load type 'Hangfire.HangfireServiceCollectionExtensions' from assembly 'Hangfire.AspNetCore, Version=1.8.17.0, Culture=neutral, PublicKeyToken=null'.'

@apobekiaris
Copy link
Member

please provide a sample

@ricardoamm
Copy link
Author

Seems to be any problem with JobSchedulerService in the :

internal static IObservable Connect(this ApplicationModulesManager manager)
=> Observable.If(() => DesignerOnlyCalculator.IsRunTime,manager.Defer(() => manager.CheckBlazor(typeof(HangfireStartup).FullName, typeof(JobSchedulerModule).Namespace)))
.Merge(manager.WhenApplication(application => application.ScheduleJobs().Merge(application.DeleteJobs())
//.MergeToUnit(application.RefreshDetailViewWhenObjectCommitted(typeof(Job)))
//.MergeToUnit(application.RefreshListViewWhenObjectCommitted())
)
.Merge(manager.TriggerJobsFromAction())
.Merge(manager.PauseJobsFromAction())
.Merge(manager.ResumeJobsFromAction())
.Merge(manager.JobDashboard())
);

Because the JobsFromActions are not executed when the buttons are clicked

@apobekiaris
Copy link
Member

yeah switching .net frameworks might seem easy but the devil is hidden there. Unfortunately I have been travelling not much time to research yet

@ricardoamm
Copy link
Author

ricardoamm commented Jan 14, 2025

thanks, i will wait.
i'm stuck

@ricardoamm
Copy link
Author

if possible, please update Hangfire dependency to Version_180

@apobekiaris
Copy link
Member

no idea what is happening with your solution neither I could run it my self. I create a new install everything as prompted used the inmem hangfire storage so jobs do not persist in each app run. Added a job and noticed executing when I Trigger actions

DXApplication1.zip

@ricardoamm
Copy link
Author

I compiled and ran your example and got exactly the same behavior.

@apobekiaris
Copy link
Member

what do u mean I put a breakpoint at the Failed moethod and was hitted

[JobProvider]
        public void Failed() {
            throw new NotImplementedException();
        }

@ricardoamm
Copy link
Author

ricardoamm commented Jan 27, 2025

Here goes de recording

recoprding.zip

@apobekiaris
Copy link
Member

this must be a new Xaf Job object created just before you trigger the job right?

@ricardoamm
Copy link
Author

yes

@ricardoamm
Copy link
Author

I have a production portal where sometimes I have to trigger jobs manually. When can I expect a solution?

@apobekiaris
Copy link
Member

I do not see how to repro your problem, my app works fine on my side and not in yours, what to say try to find alternatives e.g. maybe another machine cause I can trigger jobs manually just fine as per my video

@ricardoamm
Copy link
Author

Which video?

@apobekiaris
Copy link
Member

I guess I missed to press Comment and never post my answer b4. I attach it again, using it and follow all the steps in the video you should also get stopped in the breakpoint.

@apobekiaris
Copy link
Member

chrome_emJIcFFKjd.mp4

@apobekiaris
Copy link
Member

u can manually try to trigger the job from your own code this is Hangfire api and nothing to do with Xaf.

does that work?

@ricardoamm
Copy link
Author

ricardoamm commented Jan 30, 2025

Yes, manually through the code, I can't trigger the job.
I tried running your sample again, and the NuGet package Xpand.Xaf.Modules.JobScheduler.Hangfire version 2.424.4.3 you're using doesn't exist. Only version 4.242.4 is available. Are there any differences?

Image

@apobekiaris
Copy link
Member

use the latest version does not matter I changed nothing

@ricardoamm
Copy link
Author

ricardoamm commented Jan 30, 2025

The problem isn't related to Hangfire. it's related to the SimpleAction (Pause, Resume, Trigger, ...) in the JobSchedulerService, which are not executed when the buttons are clicked. They are subscribed but never executed.

Could you try with NuGet 4.242.4 to replicate the exact references I'm using?

@apobekiaris
Copy link
Member

That's why I suspected #1083 but my tests show it works

@ricardoamm
Copy link
Author

What can I do in the meantime?

@apobekiaris
Copy link
Member

try 4.242.4.2 is the latest lab which for sure included #1083

@ricardoamm
Copy link
Author

Its working, thanks.
I compiled the module jobscheduler with hangfire 1.8 and its Running well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug JobScheduler Reactive.XAF eXpandFrameowrk/DevExpress.XAF project
Projects
None yet
Development

No branches or pull requests

2 participants