yuzd / Hangfire.HttpJob

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

大佬帮忙看看 运行一段时间 应用关闭了。 #141

Closed arvinws closed 2 years ago

arvinws commented 2 years ago

大佬帮忙看看 运行一段时间 应用关闭了 下午远程服务器访问job管理页面 才自动恢复运行。

运行环境: winserver 2016 、iis 、mssql 日志 2021-12-16 08:36:49,456| INFO Hangfire.Server.BackgroundServerProcess Server win-panpv8js7e6:24272:ce2cd2d4 caught stopping signal...

2021-12-16 08:36:49,460| INFO Microsoft.Hosting.Lifetime Application is shutting down...

2021-12-16 08:36:49,461| INFO Hangfire.Server.BackgroundServerProcess Server win-panpv8js7e6:24272:ce2cd2d4 caught stopped signal...

2021-12-16 08:36:50,526| INFO Hangfire.Server.BackgroundServerProcess Server win-panpv8js7e6:24272:ce2cd2d4 All dispatchers stopped

2021-12-16 08:36:50,531| INFO Hangfire.Server.BackgroundServerProcess Server win-panpv8js7e6:24272:ce2cd2d4 successfully reported itself as stopped in 2.5335 ms

2021-12-16 08:36:50,531| INFO Hangfire.Server.BackgroundServerProcess Server win-panpv8js7e6:24272:ce2cd2d4 has been stopped in total 1071.1531 ms

2021-12-16 15:15:11,518| INFO Hangfire.SqlServer.SqlServerObjectsInstaller Start installing Hangfire SQL objects...

2021-12-16 15:15:11,658| INFO Hangfire.SqlServer.SqlServerObjectsInstaller Hangfire SQL objects installed.

2021-12-16 15:15:11,689| WARN Hangfire.HttpJob.HangfireHttpJobOptions GlobalSettingJsonFilePath:[E:\xxx数据推送\01.Web\hangfire_global.json] access error

System.IO.FileNotFoundException: Could not find file 'E:\xxx数据推送\01.Web\hangfire_global.json'. File name: 'E:\xxx数据推送\01.Web\hangfire_global.json' at System.IO.FileStream.ValidateFileHandle(SafeFileHandle fileHandle) at System.IO.FileStream.CreateFileOpenHandle(FileMode mode, FileShare share, FileOptions options) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) at System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding encoding, Int32 bufferSize) at System.IO.StreamReader..ctor(String path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at System.IO.File.InternalReadAllText(String path, Encoding encoding) at System.IO.File.ReadAllText(String path) at Hangfire.HttpJob.GlobalConfigurationExtension.UseHangfireHttpJob(IGlobalConfiguration config, HangfireHttpJobOptions options) 2021-12-16 15:15:11,704| INFO Hangfire.BackgroundJobServer Starting Hangfire Server using job storage: 'SQL Server: 172.168.0.9@xxxx'

2021-12-16 15:15:11,704| INFO Hangfire.BackgroundJobServer Using the following options for SQL Server job storage: Queue poll interval: 00:00:00.

2021-12-16 15:15:11,705| INFO Hangfire.BackgroundJobServer Using the following options for Hangfire Server: Worker count: 40 Listening queues: 'default', 'apis', 'recurring' Shutdown timeout: 00:30:00 Schedule polling interval: 00:00:15

2021-12-16 15:15:11,734| INFO Microsoft.Hosting.Lifetime Application started. Press Ctrl+C to shut down.

2021-12-16 15:15:11,734| INFO Microsoft.Hosting.Lifetime Hosting environment: Production

2021-12-16 15:15:11,734| INFO Microsoft.Hosting.Lifetime Content root path: E:\xxx数据推送\01.Web

2021-12-16 15:15:11,891| INFO Hangfire.Server.BackgroundServerProcess Server win-panpv8js7e6:30908:2736db2b successfully announced in 173.5577 ms

2021-12-16 15:15:11,895| INFO Hangfire.Server.BackgroundServerProcess Server win-panpv8js7e6:30908:2736db2b is starting the registered dispatchers: ServerWatchdog, ServerJobCancellationWatcher, ExpirationManager, CountersAggregator, Worker, DelayedJobScheduler, RecurringJobScheduler...

2021-12-16 15:15:11,946| INFO Hangfire.Server.BackgroundServerProcess Server win-panpv8js7e6:30908:2736db2b all the dispatchers started

yuzd commented 2 years ago

hanfire部署在iis上的话 请设置下iis应用程序池不要关闭。(默认会关闭)

请参考:

https://github.com/HangfireIO/Hangfire/issues/1022

https://github.com/HangfireIO/Hangfire/issues/1085