Hangfire.Console icon indicating copy to clipboard operation
Hangfire.Console copied to clipboard

No console output when using newest hangfire beta 1.7

Open simplicbe opened this issue 6 years ago • 6 comments

Hey,

I've currently tried to use Hangfire.Console with the current beta. My setup is very simlpe, a self hosted web api for hosting the dashboard:

...
            config
                .EnableSwagger(c =>
                {
                    c.BasicAuth("basic")
                        .Description("Basic HTTP Authentication");
                    c.SingleApiVersion("v1-0", "Simplic");
                    c.RootUrl(req => publicAddress);
                })
                .EnableSwaggerUi();

            appBuilder.UseHangfireDashboard();
                        
            appBuilder.UseWebApi(config);
...

And a server component:

....
            JobStorage.Current = GlobalConfiguration.Configuration
                .UseConsole()
                .UseMemoryStorage();

            var server = new BackgroundJobServer(new BackgroundJobServerOptions
            {
                HeartbeatInterval = TimeSpan.FromSeconds(1),
                ServerCheckInterval = TimeSpan.FromSeconds(1),
                SchedulePollingInterval = TimeSpan.FromSeconds(1)
            });
....

I get absolutly no output. I've cleared the browser cache and tried some different initialization order. Is there something more I can do to debug the issue?

EDIT: Dashboard and Server are running in the same process.

Thanks a lot!

simplicbe avatar Sep 28 '18 07:09 simplicbe

Hey, @simplicbe.

I suggest you to try another storage. Some of the required features are broken in MemoryStorage, and it hasn't been updated for a long time.

pieceofsummer avatar Oct 02 '18 22:10 pieceofsummer

I got same problem when using postgresql. any solution?

zhiyuanzhang-unai avatar Oct 17 '18 00:10 zhiyuanzhang-unai

Can anyone confirm if the extension works with 1.7.x?

Want to prevent the whole upgrade process if it's not supported thanks.

marchy avatar Jun 07 '19 15:06 marchy

@marchy yes, it does. There has been a problem with 1.7.0-beta2 due to incorrect Storage capabilities detection, but it is fixed long since.

There could be problems with some 3rd party storages, but if it has worked with your storage on 1.6.x, there’s no reason for it to break after updating to 1.7.x.

pieceofsummer avatar Jun 07 '19 15:06 pieceofsummer

That's great to hear, thanks for the quick reply Alexey.

Trying in 1.6.22 (latest of 1.6.x releases) but can't see any output on the job page in the Hangfire Dashboard. Is there any way to debug why it might not be initializing?

It seem's it should just be the one config.UseConsole() call right? Here's our Startup::ConfigureServices(..):

services.AddHangfire( _ => {
	_.UseSqlServerStorage( jobsConnectionString );
	_.UseConsole();
});

marchy avatar Jun 07 '19 16:06 marchy

Oh shoot, really sorry was totally a misnomer on our part. Confirmed up and running beautifully!

Thanks for your super-helpful extension =)

marchy avatar Jun 07 '19 17:06 marchy