marcoCasamento / Hangfire.Redis.StackExchange

HangFire Redis storage based on original (and now unsupported) Hangfire.Redis but using lovely StackExchange.Redis client
Other
460 stars 109 forks source link

Missing jobs in monitoring api when corresponding assembly is not loaded. #117

Closed joeyfallu closed 6 months ago

joeyfallu commented 1 year ago

Hi,

It would seem that when TryToGetJob() is called in the RedisMonitoringApi, the job deserialization throws an exception when the corresponding assembly is not loaded and the job is nulled. However, there is still useful information such as the arguments type name and method name. Would there be a way to return a partial job object or a different kind of object in the api such that we could access this information? The hangfireDashboard shows everything and just shows "Could not resolve assembly" so maybe something similar could be done here.

marcoCasamento commented 1 year ago

Probably. An idea could be something similar to:

public class FakeJob
{
    void FaxeExecute(object[] args){}
}

then, in case of a deserialization exception, returns a Job like this one, passing all of the information you need as arguments