Open jkodroff opened 9 years ago
Dashboard is not only showing the information about background jobs, it also allows to re-queue and delete jobs. And these commands require job type and job method in order to run all the job filters. Have you thought about using interfaces as jobs and placing them to the common assembly? In this case you aren't required to have the source code in one place, only interfaces.
@odinserj
Have you thought about using interfaces as jobs and placing them to the common assembly? In this case you aren't required to have the source code in one place, only interfaces.
How would one go about doing this?
@odinserj If assembly is not available, is it possible to display at least payload? If assembly is not available, just disable Requeue button.
This seems like it should be a simple fix. The hangfire dashboard should only display the information in the database, why would it matter whether the dll is available to the dashboard? Does the dashboard need the dll in order to do some other function?
is this still on the road map i have similar issue.
thanks.
We'd like to have a single lightweight Hangfire Dashboard to monitor all of our Hangfire instances across multiple tenants. Unfortunately, in order to display, e.g. a succeeded recurring job, we would also have to deploy the assembly which contains the job's source code or else we see an error message for each job stating "Can not find the target method". I believe this is an unnecessary restriction.
It looks like the problem lies around the
SqlServerMonitoringApi
code: TheSucceededJobDto
class has aJob
member, and in deserializing theJob
it tries to find the method to invoke via reflection in order to get the[DisplayAttribute]
etc. Instead, I think displaying the list of completed jobs should only be dependent on the data stored in the database instead of deserializing the sameJob
class that we use to run a job (i.e. Single Responsibility Principle). This makes deploying the dashboard separately a lot cleaner.I also think this is more "correct" since we should display the info for the job as it was at the time the job was run. I know that #199 addresses this issue in part (although it hasn't been merged yet), but I think this proposed solution is a little stronger in that it will display more helpful information and will more accurately reflect what was actually run, unaffected by any future changes to the code base.
Hopefully this will also allow jobs to be requeued without requiring the job code to be deployed with the dashboard.
I'm willing to submit a PR for this with @odinserj's blessing.