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

Get the Id of a Scheduled Job (IBackgroundJobManager/IBackgroundJobStore) #2645

Closed
martingagne opened this issue Oct 31, 2017 · 6 comments
Closed
Milestone

Comments

@martingagne
Copy link
Contributor

I am currently scheduling jobs from the AppService layer using IBackgroundJobManager and IBackgroundJobStore. I integrated my app with Hangfire and the integration works. When scheduling a job I see it in the Hangfire Dashboard and DB. However, when calling EnqueueAsync, I would like to get the JobId which was scheduled. This is something I could do if I was using Hangfire directly. I would use that Id to later query for it and check its status. Right now I have no ways to do that since EnqueueAsync does not give me the JobId.

How can I get the JobId at the time I schedule using IBackgroundJobManager and IBackgroundJobStore? How can I query by JobId? This needs to be done in the AppService layer.

Thank you,
Martin

@hikalkan
Copy link
Member

Currently, the only option is to directly use Hangfire API.
We can change EnqueueAsync method to return job id in future versions.

@hikalkan
Copy link
Member

hikalkan commented Nov 2, 2017

Closed by #2650

@hikalkan hikalkan closed this as completed Nov 2, 2017
@FeziFazeel
Copy link

I am currently scheduling jobs from the AppService layer using IBackgroundJobManager and IBackgroundJobStore. I integrated my app with Hangfire and the integration works. When scheduling a job I see it in the Hangfire Dashboard and DB. However, when calling EnqueueAsync, I would like to get the JobId which was scheduled. This is something I could do if I was using Hangfire directly. I would use that Id to later query for it and check its status. Right now I have no ways to do that since EnqueueAsync does not give me the JobId.

How can I get the JobId at the time I schedule using IBackgroundJobManager and IBackgroundJobStore? How can I query by JobId? This needs to be done in the AppService layer.

Thank you,
Martin

can you please provide me code that how i can use hangefire jobs in abp

@maliming
Copy link
Member

@FeziFazeel
Copy link

thanks i already have this ,but i want to confirm where i should create jobs in web.Core or in .application and from where i call these Background job ?

@maliming
Copy link
Member

maliming commented Apr 18, 2019

There is no rule on which layer to put in. You can put it in the application or core layer. It can also be called anywhere.

But I feel that I should not put it in the web-related layer.

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

No branches or pull requests

4 participants