Hangfire.Console
Hangfire.Console copied to clipboard
Constantly polling for the same output rows
I am trying to get this integrated into a project I'm working on, but are experiencing a weird issue.
When viewing the job page, the console part of the page keeps polling for "new" rows, even thought there are no new rows, and just keeps getting the same (in this case) 2 rows back, going on for what seems to be an inlimited number of time (I haven't sat around long enough to se if it stops).
I'm trying to figure out what I could have done wrong? The output, as far as I have tested, works as expected otherwise.
A short recording showing the issue. The output should just be this
+5.122s Hello, world 1
+10.132s Hello, world 2

As I see it, the extension cannot tell if the job is still in the Processing state.
What storage provider are you using? Most of weird problems are usually related to the 3rd party implementations not strictly following the rules set by the official ones.
Also check the JS console if there's any errors.
@pieceofsummer Yes, Redis is used as a storage provider, through the Hangfire.Redis.StackExchange I think. Not 110% sure about all the details, since I was not the one in my team that set this up, but the code uses this bit to configure Hangfire:
services.AddHangfire(configuration => configuration
.SetDataCompatibilityLevel(CompatibilityLevel.Version_170)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
.UseSerilogLogProvider()
.UseConsole()
.UseRedisStorage(Redis,
new Hangfire.Redis.RedisStorageOptions
{
Prefix = Configuration["Environment"]
}
));
And these are the packages related to Hangfire:
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.11" />
<PackageReference Include="Hangfire.Console" Version="1.4.2" />
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.8.4" />
I checked the JS console, but the only thing there is this:
polling was started
That's interesting. I'm using Redis provider with Console on my server with no issues. Can you provide a minimal project to reproduce your issue?
@pieceofsummer Sorry for the late reply, I'm working on getting a minimal project to you!
@pieceofsummer I have added a minimal project in a public repo: https://github.com/haxzorer/HangfireConsoleTest
When I run this, like it is described in the readme, I get the same issue that I have reported here. I would be very grateful if you could look at it, and see if there is something that I have overlooked, or just plain gotten wrong, when setting everything up!
Sorry for the delay, finally got some time to take a look.
Unfortunately, I wasn't able to reproduce the issue:

Try clearing your browser cache or trying different browser. Could be a caching issue, since Console injects own JS into Hangfire scripts.
@pieceofsummer Hmm, strange, since I tried it in both Chrome and Safari, and Safari hade previously never visited the site.
Something to note though, is that we recently deployed the project we are using this package in to AWS, using Redis through AWS, and there it works as expected! Is there some kind of Redis configuration that could/should be done locally, that you know of?
Nothing special I know of, except for key eviction should be disabled so there's no data deleted because of keyspace being filled up.
@pieceofsummer Okay, but thank you for testing it out! I'll see if I ever get it working locally. Regardless, it works beautifully in our production environment, so thank you for a nice package! 👍
Is this the same as #111? @haxzorer did you happen to run with an RTL locale on the server?
There's now a forked version with some modernization and bugfixes now on NuGet.org. Hopefully this project will come back to life at some point and the fixes can be accepted upstream 😄