Quartz.net调度程序进入待机状态(Quartz.net scheduler going to standby)
我正在使用嵌入在我的asp.net应用程序中的quartz .net服务器,但总是进入待机模式。 即使在NORMAL模式下预定的cron作业也是如此。
这些是我的调度程序属性:
var properties = new NameValueCollection(); properties["quartz.dataSource.DataSource.connectionString"] = "data source=connectionstring"; properties["quartz.dataSource.DataSource.provider"] = "SqlServer-20"; properties["quartz.scheduler.instanceName"] = "MyScheduler"; properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz"; properties["quartz.threadPool.threadCount"] = "5"; properties["quartz.threadPool.threadPriority"] = "Normal"; properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz"; properties["quartz.jobStore.driverDelegateType"] = "Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz "; properties["quartz.jobStore.tablePrefix"] = "QRTZ_"; properties["quartz.jobStore.dataSource"] = "DataSource"; properties["quartz.jobStore.useProperties"] = "true"; return new StdSchedulerFactory(properties);
如何使它始终运行? 我是否需要将其作为Windows服务运行?
I'm using quartz .net server embedded in my asp.net application but is always turning into standby mode. Even with a scheduled cron job in NORMAL mode.
Those are my scheduler properties:
var properties = new NameValueCollection(); properties["quartz.dataSource.DataSource.connectionString"] = "data source=connectionstring"; properties["quartz.dataSource.DataSource.provider"] = "SqlServer-20"; properties["quartz.scheduler.instanceName"] = "MyScheduler"; properties["quartz.threadPool.type"] = "Quartz.Simpl.SimpleThreadPool, Quartz"; properties["quartz.threadPool.threadCount"] = "5"; properties["quartz.threadPool.threadPriority"] = "Normal"; properties["quartz.jobStore.type"] = "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz"; properties["quartz.jobStore.driverDelegateType"] = "Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz "; properties["quartz.jobStore.tablePrefix"] = "QRTZ_"; properties["quartz.jobStore.dataSource"] = "DataSource"; properties["quartz.jobStore.useProperties"] = "true"; return new StdSchedulerFactory(properties);
How to make it always running? Do I need to run it as a windows service?
原文:https://stackoverflow.com/questions/18848117
最满意答案
使用
WS_EX_OVERLAPPEDWINDOW
作为CreateWindowEx
函数的第一个参数(而不是WS_OVERLAPPEDWINDOW
,它不是有效的扩展窗口样式)。Use
WS_EX_OVERLAPPEDWINDOW
as the first parameter of yourCreateWindowEx
function (instead ofWS_OVERLAPPEDWINDOW
, which is not a valid extended window style).
相关问答
更多-
Win32 API窗口无法打开(Win32 API window won't open)[2023-09-13]
使用WS_EX_OVERLAPPEDWINDOW作为CreateWindowEx函数的第一个参数(而不是WS_OVERLAPPEDWINDOW ,它不是有效的扩展窗口样式)。 Use WS_EX_OVERLAPPEDWINDOW as the first parameter of your CreateWindowEx function (instead of WS_OVERLAPPEDWINDOW, which is not a valid extended window style). -
构建Win32 GUI代码(Structuring Win32 GUI code)[2023-01-20]
对于初学者,我会看看windowsx.h中的消息破解程序 ; 他们会帮助您在窗口过程中编写乏味的案例陈述,并且在函数名称中提供了一定的规范。 For starters, I'd take a look at the message crackers in windowsx.h; they'll save you writing tedious case statements in your window procedures, and they suggest a certain discipline in ... -
为什么我的Win32 API调用需要'A'后缀,我应该纠正吗?(Why do my Win32 API calls require the 'A' suffix and should I rectify that?)[2022-05-20]
如果需要unicode字符串,则关键字为wchar_t const wchar_t g_szClassName[] = L"myWindowClass"; 编辑: 此外,请确保对未设置的结构WNDCLASSEX的其余成员进行零初始化,即 WNDCLASSEX wc = {}; 要么 ZeroMemory(&wc, sizeof(wc)); If you want unicode string, the keyword is wchar_t const wchar_t g_szClassName[] = ... -
Win32窗口无法创建?(Win32 window fails to create?)[2022-02-28]
我看到至少两个错误。 首先,你注册课程 windowClass.hInstance = hI; 但是当你创建窗口时,你会传递一个不同的HINSTANCE : m_hWnd = CreateWindowEx(dwExStyle, className, title, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, GetModuleHandle(NULL), this); // ... -
使用IsIconic功能。 use the IsIconic function.
-
要防止程序挂起,可以使用PostMessage而不是SendMessage : PostMessage(hWnd, WM_COMMAND, GetMenuItemID(hWndSubMenu, 1), 0); 您可能需要进一步研究差异: Send Message和Post Message之间的区别以及它们与C#,WPF和Pure windows编程之间的区别? To prevent your program from hanging, you can use PostMessage instead of ...
-
我在一个dll中创建了所有的winapi函数,并从c#中调用它们。 有了这个,我可以使用winapi创建一个c ++窗口,其中ac#form作为父窗口。 I made all my winapi functions in a dll and called them from c#. With this I can create a window in c++ using winapi that has a c# form as parent window.
-
使用GetOpenFileName() 。 请注意,该功能会阻止,直到用户选择文件,因此如果要在后台继续渲染等,请确保在单独的线程上运行它。 Use GetOpenFileName(). Note that that function blocks until the user selects a file, so if you want to continue rendering etc. in the background, make sure to run it on a separate threa ...
-
我不知道你的意思是“没有句柄的轻量级控件”,但我想它们是简单的C ++类(而不是真正的“控件”)必须在父窗口的客户区域上绘制。 “问题”是WM_PAINT消息是低优先级消息,如果窗口在其客户区域中具有无效部分,则在应用程序产生之前发送。 您应该首先阅读的文档是: 绘画和绘图 我建议的实现,因为我已经使用了很多次并且工作得很好,是两种方法的组合: 如果需要更“优化”的实现,则处理WM_PAINT消息(以及BeginPaint() / EndPaint()函数)以使用PAINTSTRUCT结构的rcPaint成 ...
-
可以使用TrackPopupMenu(Ex)API函数显示菜单栏或任何其他子菜单(popu菜单)的子菜单项。 此功能需要子菜单的菜单句柄和显示它的坐标。 例如,为了显示菜单栏的“文件”菜单,应采取以下操作:使用GetSubMenu(0)获取“文件”子菜单句柄; 使用GetMenuItemRect获取文件菜单项矩形; 使用矩形计算所需的坐标; TrackPopupMenu(Ex)显示菜单。 The submenu items of menubar or any other submenu (popu menu ...