Hi guys. I use hangfire pro.
I have a recurring jobs which follows the flow beloe:
- Check ftp folder every 5 minutes.
- If there is a file i’m looking for, process and import the excel data to database.
But in this case i have a lot of succeed jobs and i am unable to find which one of thoose jobs have found the excel file and proceed the process.
So, the feature i am looking for is something like job status or something like that.
Or maybe i should change my approach. But i don’t know which approach i should follow.
Please write your comments, ideas. What would u do in such case?
*one thing came up to me: take the job id by using PerformContext and delete the job which did not find the file i am looking for on the ftp(in my case)
The way I solved this exact problem was to record the Result for a job.
Most samples will have the RUN method defined as something like this:
public void Run(PerformContext context)
{
}
The thing is you can actually do this too
public string Run(PerformContext context)
{
return “New files found on FTP”;
}
The return value will be stored (out of the box by Hangfire) in the jobs Result field.
The catch is there is no real built in feature yet to triage the succeeded jobs list based on a filter (i.e. where you could say show only the jobs where Result != null)
I discussed this in greater detail in another forum post. The workaround I implemented to fix that is at best a kludge but it might be enough to get you started. The post in question is here Hide certain jobs in dashboard-log .
Hopefully this gives you an idea to get you started.
Here is the final result of my development
but it was really hard to insert datatables javascript. Because i couldnt import any js file
So i used pure javascript to import a new js file. then when it loaded i initialized to datatable
Nice, where does the Search field come from?
That’s auto generated field from jquery datatable.