yuzd / Hangfire.HttpJob

httpjob for Hangfire,restful api for Hangfire,job调度与业务分离
https://github.com/yuzd/Hangfire.HttpJob/wiki
MIT License
626 stars 185 forks source link

创建任务点击提交后没有响应 #100

Closed 786744873 closed 3 years ago

786744873 commented 3 years ago

大哥好,我在使用过程中点击提交按钮,这个时候没有任何响应,但是实际上任务创建成功了,f12看到js报错,请问是什么原因呢? image

yuzd commented 3 years ago

浏览器缓存清一清看看

786744873 commented 3 years ago

浏览器缓存清一清看看

清理完,换了好几个浏览器,发现都不行,用的是3.5.3版本的 image 大哥有qq吗?

yuzd commented 3 years ago

如果你之前用过旧的hangfire.httpjob跑过后,可能之前的某个版本有这个js报错问题。但是3.5.3版本是肯定没有的

你 f12后 Ctrl+F5 强刷清楚缓存

或者你百度搜下强制刷缓存,还不行的话加我qq1877682825

786744873 commented 3 years ago

大神,我加你了,麻烦通过下

786744873 commented 3 years ago

问题解决了,感谢大神的远程协助支持,是因为没有添加以下【UseConsole】代码

services.AddHangfire(configuration =>
{
    configuration.UseRedisStorage(new CSRedis.CSRedisClient(Configuration["HFRedis"]),new RedisStorageOptions
    {
        Prefix = "{hf}:",
        Db = 11,
    })
        .UseConsole(new ConsoleOptions
        {
            BackgroundColor = "#000079"
        })
    .UseHeartbeatPage(TimeSpan.FromSeconds(1))
    .UseHangfireHttpJob(new HangfireHttpJobOptions
    {
        DefaultRecurringQueueName = "recurring" //这个是在下面设置的queue列表中的其中一个
    })
    ;
});