You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
78 KiB
JavaScript
1 line
78 KiB
JavaScript
"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[9129],{5035:(e,r,n)=>{n.r(r),n.d(r,{assets:()=>l,contentTitle:()=>c,default:()=>a,frontMatter:()=>s,metadata:()=>o,toc:()=>t});var d=n(5893),i=n(1151);n(4996);const s={id:"job-old",title:"26. \u5b9a\u65f6\u4efb\u52a1/\u540e\u53f0\u4efb\u52a1",sidebar_label:"26. \u5b9a\u65f6\u4efb\u52a1/\u540e\u53f0\u4efb\u52a1"},c=void 0,o={id:"job-old",title:"26. \u5b9a\u65f6\u4efb\u52a1/\u540e\u53f0\u4efb\u52a1",description:"\u5728 Furion 4.8.0+ \u7248\u672c\u91c7\u7528 Sundial \u5b9a\u65f6\u4efb\u52a1\u66ff\u6362\u539f\u6709\u7684 TaskScheduler\uff0c\ud83d\ude36\u67e5\u770b\u65b0\u6587\u6863",source:"@site/docs/job-old.mdx",sourceDirName:".",slug:"/job-old",permalink:"/docs/job-old",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/job-old.mdx",tags:[],version:"current",lastUpdatedBy:"MonkSoul",lastUpdatedAt:1668770966,formattedLastUpdatedAt:"Nov 18, 2022",frontMatter:{id:"job-old",title:"26. \u5b9a\u65f6\u4efb\u52a1/\u540e\u53f0\u4efb\u52a1",sidebar_label:"26. \u5b9a\u65f6\u4efb\u52a1/\u540e\u53f0\u4efb\u52a1"}},l={},t=[{value:"26.1 \u5173\u4e8e\u5b9a\u65f6\u4efb\u52a1",id:"261-\u5173\u4e8e\u5b9a\u65f6\u4efb\u52a1",level:2},{value:"26.2 \u5982\u4f55\u5b9e\u73b0",id:"262-\u5982\u4f55\u5b9e\u73b0",level:2},{value:"26.3 \u7f13\u9694\u65b9\u5f0f\u4f7f\u7528",id:"263-\u7f13\u9694\u65b9\u5f0f\u4f7f\u7528",level:2},{value:"26.3.1 \u7279\u5b9a\u65f6\u95f4\u540e\u6267\u884c",id:"2631-\u7279\u5b9a\u65f6\u95f4\u540e\u6267\u884c",level:3},{value:"26.3.2 \u914d\u7f6e\u4efb\u52a1\u4fe1\u606f",id:"2632-\u914d\u7f6e\u4efb\u52a1\u4fe1\u606f",level:3},{value:"26.3.3 \u624b\u52a8\u542f\u52a8\u6267\u884c",id:"2633-\u624b\u52a8\u542f\u52a8\u6267\u884c",level:3},{value:"26.3.4 \u6a21\u62df\u540e\u53f0\u6267\u884c",id:"2634-\u6a21\u62df\u540e\u53f0\u6267\u884c",level:3},{value:"26.3.5 <code>ISpareTimeWorker</code> \u65b9\u5f0f",id:"2635-isparetimeworker-\u65b9\u5f0f",level:3},{value:"26.4 \u95f4\u9694\u65b9\u5f0f\u4f7f\u7528",id:"264-\u95f4\u9694\u65b9\u5f0f\u4f7f\u7528",level:2},{value:"26.4.1 \u6bcf\u9694\u4e00\u6bb5\u65f6\u95f4\u6267\u884c",id:"2641-\u6bcf\u9694\u4e00\u6bb5\u65f6\u95f4\u6267\u884c",level:3},{value:"26.4.2 \u914d\u7f6e\u4efb\u52a1\u4fe1\u606f",id:"2642-\u914d\u7f6e\u4efb\u52a1\u4fe1\u606f",level:3},{value:"26.4.3 \u624b\u52a8\u542f\u52a8\u6267\u884c",id:"2643-\u624b\u52a8\u542f\u52a8\u6267\u884c",level:3},{value:"26.4.4 <code>ISpareTimeWorker</code> \u65b9\u5f0f",id:"2644-isparetimeworker-\u65b9\u5f0f",level:3},{value:"26.5 <code>Cron</code> \u8868\u8fbe\u5f0f\u4f7f\u7528",id:"265-cron-\u8868\u8fbe\u5f0f\u4f7f\u7528",level:2},{value:"26.5.1 \u4ec0\u4e48\u662f <code>Cron</code> \u8868\u8fbe\u5f0f",id:"2651-\u4ec0\u4e48\u662f-cron-\u8868\u8fbe\u5f0f",level:3},{value:"26.5.2 \u5e38\u89c1 <code>Cron</code> \u8868\u8fbe\u5f0f",id:"2652-\u5e38\u89c1-cron-\u8868\u8fbe\u5f0f",level:3},{value:"26.5.3 \u5728\u7ebf\u751f\u6210 <code>Cron</code> \u8868\u8fbe\u5f0f",id:"2653-\u5728\u7ebf\u751f\u6210-cron-\u8868\u8fbe\u5f0f",level:3},{value:"26.5.4 <code>Macro</code> \u6807\u8bc6\u7b26",id:"2654-macro-\u6807\u8bc6\u7b26",level:3},{value:"26.5.5 \u4f7f\u7528 <code>Cron</code> \u8868\u8fbe\u5f0f",id:"2655-\u4f7f\u7528-cron-\u8868\u8fbe\u5f0f",level:3},{value:"26.5.6 \u4f7f\u7528 <code>Macro</code> \u5360\u4f4d\u7b26",id:"2656-\u4f7f\u7528-macro-\u5360\u4f4d\u7b26",level:3},{value:"26.5.7 \u914d\u7f6e\u4efb\u52a1\u4fe1\u606f",id:"2657-\u914d\u7f6e\u4efb\u52a1\u4fe1\u606f",level:3},{value:"26.5.8 \u624b\u52a8\u542f\u52a8\u6267\u884c",id:"2658-\u624b\u52a8\u542f\u52a8\u6267\u884c",level:3},{value:"26.5.9 <code>ISpareTimeWorker</code> \u65b9\u5f0f",id:"2659-isparetimeworker-\u65b9\u5f0f",level:3},{value:"26.6 \u81ea\u5b9a\u4e49\u4e0b\u6b21\u6267\u884c\u65f6\u95f4",id:"266-\u81ea\u5b9a\u4e49\u4e0b\u6b21\u6267\u884c\u65f6\u95f4",level:2},{value:"26.6.1 \u9ad8\u7ea7\u81ea\u5b9a\u4e49\u95f4\u9694\u65b9\u5f0f",id:"2661-\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u95f4\u9694\u65b9\u5f0f",level:3},{value:"26.6.2 \u9ad8\u7ea7\u81ea\u5b9a\u4e49 <code>Cron</code> \u8868\u8fbe\u5f0f",id:"2662-\u9ad8\u7ea7\u81ea\u5b9a\u4e49-cron-\u8868\u8fbe\u5f0f",level:3},{value:"26.7 <code>ISpareTimeWorker</code> \u8bf4\u660e",id:"267-isparetimeworker-\u8bf4\u660e",level:2},{value:"26.7.1 <code>[SpareTime]</code> \u7279\u6027",id:"2671-sparetime-\u7279\u6027",level:3},{value:"26.8 <code>SpareTime</code> \u9759\u6001\u7c7b",id:"268-sparetime-\u9759\u6001\u7c7b",level:2},{value:"26.8.1 \u521d\u59cb\u5316\u4efb\u52a1",id:"2681-\u521d\u59cb\u5316\u4efb\u52a1",level:3},{value:"26.8.2 \u5b9e\u73b0\u540e\u53f0\u6267\u884c",id:"2682-\u5b9e\u73b0\u540e\u53f0\u6267\u884c",level:3},{value:"26.8.3 \u5f00\u59cb\u4e00\u4e2a\u4efb\u52a1",id:"2683-\u5f00\u59cb\u4e00\u4e2a\u4efb\u52a1",level:3},{value:"26.8.4 \u6682\u505c\u4e00\u4e2a\u4efb\u52a1",id:"2684-\u6682\u505c\u4e00\u4e2a\u4efb\u52a1",level:3},{value:"26.8.5 \u53d6\u6d88\u4e00\u4e2a\u4efb\u52a1",id:"2685-\u53d6\u6d88\u4e00\u4e2a\u4efb\u52a1",level:3},{value:"26.8.6 \u9500\u6bc1\u6240\u6709\u4efb\u52a1",id:"2686-\u9500\u6bc1\u6240\u6709\u4efb\u52a1",level:3},{value:"26.8.7 \u83b7\u53d6\u6240\u6709\u4efb\u52a1",id:"2687-\u83b7\u53d6\u6240\u6709\u4efb\u52a1",level:3},{value:"26.8.8 \u83b7\u53d6\u5355\u4e2a\u4efb\u52a1",id:"2688-\u83b7\u53d6\u5355\u4e2a\u4efb\u52a1",level:3},{value:"26.8.9 \u89e3\u6790 <code>Cron</code> \u8868\u8fbe\u5f0f",id:"2689-\u89e3\u6790-cron-\u8868\u8fbe\u5f0f",level:3},{value:"26.9 <code>\u5e76\u884c</code>\u548c<code>\u4e32\u884c</code>\u6267\u884c\u65b9\u5f0f",id:"269-\u5e76\u884c\u548c\u4e32\u884c\u6267\u884c\u65b9\u5f0f",level:2},{value:"26.9.1 <code>SpareTime</code> \u9759\u6001\u65b9\u5f0f\u6307\u5b9a",id:"2691-sparetime-\u9759\u6001\u65b9\u5f0f\u6307\u5b9a",level:3},{value:"26.9.2 <code>ISpareTimeWorker</code> \u65b9\u5f0f",id:"2692-isparetimeworker-\u65b9\u5f0f",level:3},{value:"26.10 \u4efb\u52a1\u5f02\u5e38\u5904\u7406",id:"2610-\u4efb\u52a1\u5f02\u5e38\u5904\u7406",level:2},{value:"26.11 \u5982\u4f55\u5728\u4efb\u52a1\u4e2d\u89e3\u6790\u5bf9\u8c61",id:"2611-\u5982\u4f55\u5728\u4efb\u52a1\u4e2d\u89e3\u6790\u5bf9\u8c61",level:2},{value:"26.11.1 <code>SpareTime</code> \u9759\u6001\u7c7b\u4e2d",id:"26111-sparetime-\u9759\u6001\u7c7b\u4e2d",level:3},{value:"26.11.2 <code>ISpareTimeWorker</code> \u65b9\u5f0f",id:"26112-isparetimeworker-\u65b9\u5f0f",level:3},{value:"26.12 \u5728 <code>BackgroundService</code> \u4e2d\u4f7f\u7528",id:"2612-\u5728-backgroundservice-\u4e2d\u4f7f\u7528",level:2},{value:"26.12.1 \u95f4\u9694\u6267\u884c\u65b9\u5f0f",id:"26121-\u95f4\u9694\u6267\u884c\u65b9\u5f0f",level:3},{value:"26.12.2 <code>Cron</code> \u8868\u8fbe\u5f0f\u6267\u884c\u65b9\u5f0f",id:"26122-cron-\u8868\u8fbe\u5f0f\u6267\u884c\u65b9\u5f0f",level:3},{value:"26.13 \u5b9a\u65f6\u4efb\u52a1\u76d1\u542c\u5668",id:"2613-\u5b9a\u65f6\u4efb\u52a1\u76d1\u542c\u5668",level:2},{value:"26.13.1 <code>SpareTimerExecuter</code> \u5c5e\u6027\u8bf4\u660e",id:"26131-sparetimerexecuter-\u5c5e\u6027\u8bf4\u660e",level:3},{value:"26.14 IIS \u90e8\u7f72\u56de\u6536\u8bbe\u7f6e",id:"2614-iis-\u90e8\u7f72\u56de\u6536\u8bbe\u7f6e",level:2},{value:"26.15 \u53cd\u9988\u4e0e\u5efa\u8bae",id:"2615-\u53cd\u9988\u4e0e\u5efa\u8bae",level:2}];function h(e){const r={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.a)(),...e.components};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(r.admonition,{title:"4.8.0+ \u7248\u672c\u8bf4\u660e",type:"warning",children:[(0,d.jsxs)(r.p,{children:[(0,d.jsxs)(r.strong,{children:["\u5728 ",(0,d.jsx)(r.code,{children:"Furion 4.8.0+"})," \u7248\u672c\u91c7\u7528 ",(0,d.jsx)(r.a,{href:"https://gitee.com/dotnetchina/Sundial",children:"Sundial"})," \u5b9a\u65f6\u4efb\u52a1\u66ff\u6362\u539f\u6709\u7684 ",(0,d.jsx)(r.code,{children:"TaskScheduler"})]}),"\uff0c",(0,d.jsxs)(r.strong,{children:["\ud83d\ude36",(0,d.jsx)(r.a,{href:"/docs/job",children:"\u67e5\u770b\u65b0\u6587\u6863"})]})]}),(0,d.jsxs)(r.p,{children:["\u65e7\u7248\u672c\u5c06\u652f\u6301\u5230 ",(0,d.jsx)(r.code,{children:"2022\u5e7412\u670831\u65e5"}),"\uff0c\u4e4b\u540e\u65e7\u7248\u672c\u4ee3\u7801\u4ece\u6846\u67b6\u4e2d\u79fb\u9664\uff0c\u8bf7\u5c3d\u5feb\u4f7f\u7528\u65b0\u7248\u672c\u66ff\u4ee3\u3002"]})]}),"\n",(0,d.jsx)(r.admonition,{title:"\u7248\u672c\u8bf4\u660e",type:"important",children:(0,d.jsxs)(r.p,{children:["\u4ee5\u4e0b\u5185\u5bb9\u4ec5\u9650 ",(0,d.jsx)(r.code,{children:"Furion 2.0.0 +"})," \u7248\u672c\u4f7f\u7528\u3002"]})}),"\n",(0,d.jsx)(r.admonition,{title:"IIS \u90e8\u7f72\u8bf4\u660e",type:"tip",children:(0,d.jsxs)(r.p,{children:["\u7531\u4e8e IIS \u6709\u56de\u6536\u7684\u673a\u5236\uff0c\u6240\u4ee5\u5b9a\u65f6\u4efb\u52a1\u5e94\u8be5\u91c7\u7528\u72ec\u7acb\u90e8\u7f72\uff0c\u4e0d\u7136\u7ecf\u5e38\u51fa\u73b0\u4e0d\u80fd\u89e6\u53d1\u7684\u60c5\u51b5\u3002\u67e5\u770b\u3010",(0,d.jsx)(r.a,{href:"/docs/process-service",children:"Worker Service \u7ae0\u8282"}),"\u3011"]})}),"\n","\n","\n",(0,d.jsx)(r.h2,{id:"261-\u5173\u4e8e\u5b9a\u65f6\u4efb\u52a1",children:"26.1 \u5173\u4e8e\u5b9a\u65f6\u4efb\u52a1"}),"\n",(0,d.jsx)(r.p,{children:"\u987e\u540d\u601d\u4e49\uff0c\u5b9a\u65f6\u4efb\u52a1\u5c31\u662f\u5728\u7279\u5b9a\u7684\u65f6\u95f4\u6216\u7b26\u5408\u67d0\u79cd\u65f6\u95f4\u89c4\u5f8b\u6267\u884c\u7684\u4efb\u52a1\u3002\u901a\u5e38\u5b9a\u65f6\u4efb\u52a1\u6709\u56db\u79cd\u65f6\u95f4\u8c03\u5ea6\u65b9\u5f0f\uff1a"}),"\n",(0,d.jsxs)(r.ul,{children:["\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"\u7f13\u9694\u65f6\u95f4"})," \u65b9\u5f0f\uff1a\u5ef6\u8fdf\u591a\u5c11\u65f6\u95f4\u540e\u8c03\u914d\u4efb\u52a1\uff0c\u8fd9\u79cd\u65b9\u5f0f\u4efb\u52a1\u53ea\u4f1a\u88ab\u8c03\u7528\u4e00\u6b21\u3002"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"\u95f4\u9694\u65f6\u95f4"})," \u65b9\u5f0f\uff1a\u6bcf\u9694\u4e00\u6bb5\u56fa\u5b9a\u65f6\u95f4\u8c03\u914d\u4efb\u52a1\uff0c\u65e0\u95f4\u65ad\u8c03\u7528\u4efb\u52a1\u3002"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"Cron \u8868\u8fbe\u5f0f"})," \u65b9\u6cd5\uff1a\u901a\u8fc7 ",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f\u8ba1\u7b97\u4e0b\u4e00\u6b21\u6267\u884c\u65f6\u95f4\u8fdb\u884c\u8c03\u914d\u4efb\u52a1\uff0c\u53ef\u4ee5\u914d\u7f6e\u7279\u5b9a\u65f6\u95f4\u8303\u56f4\u5185\u6267\u884c\uff0c\u4e5f\u53ef\u4ee5\u65e0\u95f4\u65ad\u6267\u884c\u3002"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"\u81ea\u5b9a\u4e49\u4e0b\u6b21\u6267\u884c\u65f6\u95f4"}),"\uff1a\u53ef\u4ee5\u901a\u8fc7\u5404\u79cd\u903b\u8f91\u8fd0\u7b97\u8fd4\u56de\u4e0b\u4e00\u6b21\u6267\u884c\u65f6\u95f4"]}),"\n"]}),"\n",(0,d.jsx)(r.h2,{id:"262-\u5982\u4f55\u5b9e\u73b0",children:"26.2 \u5982\u4f55\u5b9e\u73b0"}),"\n",(0,d.jsxs)(r.p,{children:[(0,d.jsx)(r.code,{children:"Furion"})," \u6846\u67b6\u63d0\u4f9b\u4e86\u4e24\u79cd\u65b9\u5f0f\u5b9e\u73b0\u5b9a\u65f6\u4efb\u52a1\uff1a"]}),"\n",(0,d.jsxs)(r.ul,{children:["\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"SpareTime"})," \u9759\u6001\u7c7b\uff1a",(0,d.jsx)(r.code,{children:"SpareTime"})," \u9759\u6001\u7c7b\u63d0\u4f9b ",(0,d.jsx)(r.code,{children:"SpareTime.Do([options])"})," \u65b9\u5f0f\u8c03\u7528\u3002"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u4f9d\u8d56\u65b9\u5f0f\uff1a\u901a\u8fc7\u81ea\u5b9a\u4e49\u7c7b\u5b9e\u73b0 ",(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u63a5\u53e3\u5e76\u7f16\u5199\u4e00\u5b9a\u89c4\u5219\u7684\u65b9\u6cd5\u5373\u53ef\u3002",(0,d.jsxs)(r.strong,{children:["\u9700\u8981\u5728 ",(0,d.jsx)(r.code,{children:"Startup.cs"})," \u4e2d\u6ce8\u518c ",(0,d.jsx)(r.code,{children:"services.AddTaskScheduler()"})]})]}),"\n"]}),"\n",(0,d.jsx)(r.h2,{id:"263-\u7f13\u9694\u65b9\u5f0f\u4f7f\u7528",children:"26.3 \u7f13\u9694\u65b9\u5f0f\u4f7f\u7528"}),"\n",(0,d.jsx)(r.h3,{id:"2631-\u7279\u5b9a\u65f6\u95f4\u540e\u6267\u884c",children:"26.3.1 \u7279\u5b9a\u65f6\u95f4\u540e\u6267\u884c"}),"\n",(0,d.jsxs)(r.p,{children:["\u8fd9\u91cc\u6f14\u793a ",(0,d.jsx)(r.code,{children:"3s"})," \u540e\u6267\u884c"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {5}",children:'Console.WriteLine("\u5f53\u524d\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n\r\n// timer \u662f\u5b9a\u65f6\u5668\u7684\u5bf9\u8c61\uff0c\u5305\u542b\u5b9a\u65f6\u5668\u76f8\u5173\u4fe1\u606f\r\n// count \u8868\u793a\u6267\u884c\u6b21\u6570\uff0c\u8fd9\u91cc\u53ea\u6709\u4e00\u6b21\r\nSpareTime.DoOnce(3000, (timer, count) => {\r\n Console.WriteLine("\u73b0\u5728\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n});\n'})}),"\n",(0,d.jsx)(r.h3,{id:"2632-\u914d\u7f6e\u4efb\u52a1\u4fe1\u606f",children:"26.3.2 \u914d\u7f6e\u4efb\u52a1\u4fe1\u606f"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {3}",children:'SpareTime.DoOnce(3000, (timer, count) => {\r\n Console.WriteLine("\u73b0\u5728\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n}, "jobName", "\u63cf\u8ff0\u4e00\u4e0b\u8fd9\u4e2a\u4efb\u52a1\u662f\u5e72\u4ec0\u4e48\u7684");\n'})}),"\n",(0,d.jsxs)(r.p,{children:[(0,d.jsx)(r.code,{children:"jobName"})," \u6807\u8bc6\u4efb\u52a1\u7684\u552f\u4e00\u6807\u8bc6\uff0c\u901a\u8fc7\u8fd9\u4e2a\u6807\u8bc6\u53ef\u4ee5\u542f\u52a8\u3001\u6682\u505c\u3001\u9500\u6bc1\u4efb\u52a1\u3002"]}),"\n",(0,d.jsx)(r.h3,{id:"2633-\u624b\u52a8\u542f\u52a8\u6267\u884c",children:"26.3.3 \u624b\u52a8\u542f\u52a8\u6267\u884c"}),"\n",(0,d.jsxs)(r.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u4efb\u52a1\u521d\u59cb\u5316\u540e\u5c31\u7acb\u5373\u542f\u52a8\uff0c\u7b49\u5f85\u7b26\u5408\u7684\u65f6\u95f4\u5c31\u6267\u884c\uff0c\u6709\u4e9b\u65f6\u5019\u6211\u4eec\u4ec5\u4ec5\u60f3\u521d\u59cb\u5316\u65f6\u95f4\uff0c\u4e0d\u5e0c\u671b\u7acb\u5373\u6267\u884c\uff0c\u53ea\u9700\u8981\u914d\u7f6e ",(0,d.jsx)(r.code,{children:"startNow"})," \u5373\u53ef\uff1a"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {3,6}",children:'SpareTime.DoOnce(3000, (timer, count) => {\r\n Console.WriteLine("\u73b0\u5728\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n},"jobName", startNow: false);\r\n\r\n// \u624b\u52a8\u542f\u52a8\u6267\u884c\r\nSpareTime.Start("jobName");\n'})}),"\n",(0,d.jsx)(r.h3,{id:"2634-\u6a21\u62df\u540e\u53f0\u6267\u884c",children:"26.3.4 \u6a21\u62df\u540e\u53f0\u6267\u884c"}),"\n",(0,d.jsx)(r.p,{children:"\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u53ea\u9700\u8981\u5f00\u542f\u65b0\u7ebf\u7a0b\u53bb\u6267\u884c\u4e00\u4e2a\u4efb\u52a1\uff0c\u6bd4\u5982\u53d1\u77ed\u4fe1\uff0c\u53d1\u90ae\u4ef6\uff0c\u65e0\u9700\u914d\u7f6e\u3002"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {2}",children:"// \u6b64\u65b9\u6cd5\u65e0\u9700\u4e3b\u7ebf\u7a0b\u7b49\u5f85\u5373\u53ef\u8fd4\u56de\uff0c\u53ef\u5927\u5927\u63d0\u9ad8\u6027\u80fd\r\nSpareTime.DoIt(() => {\r\n // \u8fd9\u91cc\u53d1\u9001\u77ed\u4fe1\uff0c\u53d1\u9001\u90ae\u4ef6\u6216\u8bb0\u5f55\u8bbf\u95ee\u8bb0\u5f55\r\n});\n"})}),"\n",(0,d.jsxs)(r.p,{children:["\u8fd8\u53ef\u4ee5\u6307\u5b9a\u591a\u957f\u65f6\u95f4\u540e\u89e6\u53d1\uff0c\u5efa\u8bae ",(0,d.jsx)(r.code,{children:"10-1000"})," \u6beb\u79d2\u4e4b\u95f4\uff1a"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {3}",children:"SpareTime.DoIt(() => {\r\n // \u53d1\u9001\u77ed\u4fe1\r\n}, 100);\n"})}),"\n",(0,d.jsxs)(r.h3,{id:"2635-isparetimeworker-\u65b9\u5f0f",children:["26.3.5 ",(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u65b9\u5f0f"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {1,8}",children:'public class JobWorker : ISpareTimeWorker\r\n{\r\n /// <summary>\r\n /// 3s \u540e\u6267\u884c\r\n /// </summary>\r\n /// <param name="timer"></param>\r\n /// <param name="count"></param>\r\n [SpareTime(3000, "jobName", DoOnce = true, StartNow = true)]\r\n public void DoSomething(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n }\r\n\r\n /// <summary>\r\n /// 3s \u540e\u6267\u884c\uff08\u652f\u6301\u5f02\u6b65\uff09\r\n /// </summary>\r\n /// <param name="timer"></param>\r\n /// <param name="count"></param>\r\n [SpareTime(3000, "jobName", DoOnce = true, StartNow = true)]\r\n public async Task DoSomethingAsync(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n await Task.CompletedTask;\r\n }\r\n}\n'})}),"\n",(0,d.jsx)(r.p,{children:(0,d.jsxs)(r.strong,{children:["\u9700\u8981\u5728 ",(0,d.jsx)(r.code,{children:"Startup.cs"})," \u4e2d\u6ce8\u518c ",(0,d.jsx)(r.code,{children:"services.AddTaskScheduler()"})]})}),"\n",(0,d.jsx)(r.h2,{id:"264-\u95f4\u9694\u65b9\u5f0f\u4f7f\u7528",children:"26.4 \u95f4\u9694\u65b9\u5f0f\u4f7f\u7528"}),"\n",(0,d.jsx)(r.h3,{id:"2641-\u6bcf\u9694\u4e00\u6bb5\u65f6\u95f4\u6267\u884c",children:"26.4.1 \u6bcf\u9694\u4e00\u6bb5\u65f6\u95f4\u6267\u884c"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {2}",children:'// \u6bcf\u9694 1s \u6267\u884c\r\nSpareTime.Do(1000, (timer, count) => {\r\n Console.WriteLine("\u73b0\u5728\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n});\n'})}),"\n",(0,d.jsx)(r.h3,{id:"2642-\u914d\u7f6e\u4efb\u52a1\u4fe1\u606f",children:"26.4.2 \u914d\u7f6e\u4efb\u52a1\u4fe1\u606f"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {1,4}",children:'SpareTime.Do(1000, (timer, count) => {\r\n Console.WriteLine("\u73b0\u5728\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n}, "jobName", "\u8fd9\u662f\u4e00\u4e2a\u8ba1\u65f6\u5668\u4efb\u52a1");\n'})}),"\n",(0,d.jsx)(r.h3,{id:"2643-\u624b\u52a8\u542f\u52a8\u6267\u884c",children:"26.4.3 \u624b\u52a8\u542f\u52a8\u6267\u884c"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {1,4,6}",children:'SpareTime.Do(1000, (timer, count) => {\r\n Console.WriteLine("\u73b0\u5728\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n}, "jobName", startNow:false);\r\n\r\nSpareTime.Start("jobName");\n'})}),"\n",(0,d.jsxs)(r.h3,{id:"2644-isparetimeworker-\u65b9\u5f0f",children:["26.4.4 ",(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u65b9\u5f0f"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {1,8}",children:'public class JobWorker : ISpareTimeWorker\r\n{\r\n /// <summary>\r\n /// \u6bcf\u9694 3s \u6267\u884c\r\n /// </summary>\r\n /// <param name="timer"></param>\r\n /// <param name="count"></param>\r\n [SpareTime(3000, "jobName", StartNow = true)]\r\n public void DoSomething(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n }\r\n}\n'})}),"\n",(0,d.jsx)(r.p,{children:(0,d.jsxs)(r.strong,{children:["\u9700\u8981\u5728 ",(0,d.jsx)(r.code,{children:"Startup.cs"})," \u4e2d\u6ce8\u518c ",(0,d.jsx)(r.code,{children:"services.AddTaskScheduler()"})]})}),"\n",(0,d.jsxs)(r.h2,{id:"265-cron-\u8868\u8fbe\u5f0f\u4f7f\u7528",children:["26.5 ",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f\u4f7f\u7528"]}),"\n",(0,d.jsxs)(r.h3,{id:"2651-\u4ec0\u4e48\u662f-cron-\u8868\u8fbe\u5f0f",children:["26.5.1 \u4ec0\u4e48\u662f ",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f"]}),"\n",(0,d.jsxs)(r.p,{children:["Cron \u8868\u8fbe\u5f0f\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u5b57\u7b26\u4e32\u4ee5 ",(0,d.jsx)(r.code,{children:"5"})," \u6216 ",(0,d.jsx)(r.code,{children:"6"})," \u4e2a\u7a7a\u683c\u9694\u5f00\uff0c\u5206\u4e3a 6 \u6216 7 \u4e2a\u57df\uff0c\u6bcf\u4e00\u4e2a\u57df\u4ee3\u8868\u4e00\u4e2a\u542b\u4e49\uff0cCron \u6709\u5982\u4e0b\u4e24\u79cd\u8bed\u6cd5\u683c\u5f0f\uff1a"]}),"\n",(0,d.jsx)(r.p,{children:"\uff081\uff09 Seconds Minutes Hours DayofMonth Month DayofWeek Year"}),"\n",(0,d.jsx)(r.p,{children:"\uff082\uff09Seconds Minutes Hours DayofMonth Month DayofWeek"}),"\n",(0,d.jsxs)(r.p,{children:["Cron \u4ece\u5de6\u5230\u53f3\uff08\u7528\u7a7a\u683c\u9694\u5f00\uff09\uff1a",(0,d.jsx)(r.code,{children:"\u79d2"})," ",(0,d.jsx)(r.code,{children:"\u5206"})," ",(0,d.jsx)(r.code,{children:"\u5c0f\u65f6"})," ",(0,d.jsx)(r.code,{children:"\u6708\u4efd\u4e2d\u7684\u65e5\u671f"})," ",(0,d.jsx)(r.code,{children:"\u6708\u4efd"})," ",(0,d.jsx)(r.code,{children:"\u661f\u671f\u4e2d\u7684\u65e5\u671f"})," ",(0,d.jsx)(r.code,{children:"\u5e74\u4efd"})]}),"\n",(0,d.jsxs)(r.table,{children:[(0,d.jsx)(r.thead,{children:(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.th,{children:"\u5b57\u6bb5"}),(0,d.jsx)(r.th,{children:"\u5141\u8bb8\u503c"}),(0,d.jsx)(r.th,{children:"\u5141\u8bb8\u7684\u7279\u6b8a\u5b57\u7b26"})]})}),(0,d.jsxs)(r.tbody,{children:[(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:"\u79d2\uff08Seconds\uff09"}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:"0~59"})," \u7684\u6574\u6570"]}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:", - \\* /"})," \u56db\u4e2a\u5b57\u7b26"]})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:"\u5206\uff08Minutes\uff09"}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:"0~59"})," \u7684\u6574\u6570"]}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:", - \\* /"})," \u56db\u4e2a\u5b57\u7b26"]})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:"\u5c0f\u65f6\uff08Hours\uff09"}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:"0~23"})," \u7684\u6574\u6570"]}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:", - \\* /"})," \u56db\u4e2a\u5b57\u7b26"]})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:"\u65e5\u671f\uff08DayofMonth\uff09"}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:"1~31"})," \u7684\u6574\u6570\uff08\u4f46\u662f\u4f60\u9700\u8981\u8003\u8651\u5e73\u95f0\u6708\u7684\u5929\u6570\uff09"]}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:",- \\* ? / L W C"})," \u516b\u4e2a\u5b57\u7b26"]})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:"\u6708\u4efd\uff08Month\uff09"}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:"1~12"})," \u7684\u6574\u6570\u6216\u8005 ",(0,d.jsx)(r.code,{children:"JAN-DEC"})]}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:", - \\* /"})," \u56db\u4e2a\u5b57\u7b26"]})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:"\u661f\u671f\uff08DayofWeek\uff09"}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:"1~7"})," \u7684\u6574\u6570\u6216\u8005 ",(0,d.jsx)(r.code,{children:"SUN-SAT \uff081=SUN\uff09"})]}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:", - \\* ? / L C #"})," \u516b\u4e2a\u5b57\u7b26"]})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:"\u5e74(\u53ef\u9009\uff0c\u7559\u7a7a)\uff08Year\uff09"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"1970~2099"})}),(0,d.jsxs)(r.td,{children:[(0,d.jsx)(r.code,{children:", - \\* /"})," \u56db\u4e2a\u5b57\u7b26"]})]})]})]}),"\n",(0,d.jsx)(r.p,{children:"\u6bcf\u4e00\u4e2a\u57df\u90fd\u4f7f\u7528\u6570\u5b57\uff0c\u4f46\u8fd8\u53ef\u4ee5\u51fa\u73b0\u5982\u4e0b\u7279\u6b8a\u5b57\u7b26\uff0c\u5b83\u4eec\u7684\u542b\u4e49\u662f\uff1a"}),"\n",(0,d.jsxs)(r.p,{children:["\uff081\uff09",(0,d.jsx)(r.code,{children:"_"}),"\uff1a\u8868\u793a\u5339\u914d\u8be5\u57df\u7684\u4efb\u610f\u503c\u3002\u5047\u5982\u5728 ",(0,d.jsx)(r.code,{children:"Minutes"})," \u57df\u4f7f\u7528 ",(0,d.jsx)(r.code,{children:"\\_"}),", \u5373\u8868\u793a\u6bcf\u5206\u949f\u90fd\u4f1a\u89e6\u53d1\u4e8b\u4ef6\u3002"]}),"\n",(0,d.jsxs)(r.p,{children:["\uff082\uff09",(0,d.jsx)(r.code,{children:"?"}),"\uff1a\u53ea\u80fd\u7528\u5728 ",(0,d.jsx)(r.code,{children:"DayofMonth"})," \u548c ",(0,d.jsx)(r.code,{children:"DayofWeek"})," \u4e24\u4e2a\u57df\u3002\u5b83\u4e5f\u5339\u914d\u57df\u7684\u4efb\u610f\u503c\uff0c\u4f46\u5b9e\u9645\u4e0d\u4f1a\u3002\u56e0\u4e3a ",(0,d.jsx)(r.code,{children:"DayofMonth"})," \u548c ",(0,d.jsx)(r.code,{children:"DayofWeek"})," \u4f1a\u76f8\u4e92\u5f71\u54cd\u3002\u4f8b\u5982\u60f3\u5728\u6bcf\u6708\u7684 ",(0,d.jsx)(r.code,{children:"20"})," \u65e5\u89e6\u53d1\u8c03\u5ea6\uff0c\u4e0d\u7ba1 ",(0,d.jsx)(r.code,{children:"20"})," \u65e5\u5230\u5e95\u662f\u661f\u671f\u51e0\uff0c\u5219\u53ea\u80fd\u4f7f\u7528\u5982\u4e0b\u5199\u6cd5\uff1a ",(0,d.jsx)(r.code,{children:"13 13 15 20 _ ?"}),", \u5176\u4e2d\u6700\u540e\u4e00\u4f4d\u53ea\u80fd\u7528",(0,d.jsx)(r.code,{children:"\uff1f"}),"\uff0c\u800c\u4e0d\u80fd\u4f7f\u7528_\uff0c\u5982\u679c\u4f7f\u7528*\u8868\u793a\u4e0d\u7ba1\u661f\u671f\u51e0\u90fd\u4f1a\u89e6\u53d1\uff0c\u5b9e\u9645\u4e0a\u5e76\u4e0d\u662f\u8fd9\u6837\u3002"]}),"\n",(0,d.jsxs)(r.p,{children:["\uff083\uff09",(0,d.jsx)(r.code,{children:"-"}),"\uff1a\u8868\u793a\u8303\u56f4\u3002\u4f8b\u5982\u5728 ",(0,d.jsx)(r.code,{children:"Minutes"})," \u57df\u4f7f\u7528 ",(0,d.jsx)(r.code,{children:"5-20"}),"\uff0c\u8868\u793a\u4ece ",(0,d.jsx)(r.code,{children:"5"})," \u5206\u5230 ",(0,d.jsx)(r.code,{children:"20"})," \u5206\u949f\u6bcf\u5206\u949f\u89e6\u53d1\u4e00\u6b21"]}),"\n",(0,d.jsxs)(r.p,{children:["\uff084\uff09",(0,d.jsx)(r.code,{children:"/"}),"\uff1a\u8868\u793a\u8d77\u59cb\u65f6\u95f4\u5f00\u59cb\u89e6\u53d1\uff0c\u7136\u540e\u6bcf\u9694\u56fa\u5b9a\u65f6\u95f4\u89e6\u53d1\u4e00\u6b21\u3002\u4f8b\u5982\u5728 ",(0,d.jsx)(r.code,{children:"Minutes"})," \u57df\u4f7f\u7528 ",(0,d.jsx)(r.code,{children:"5/20"}),"\uff0c\u5219\u610f\u5473\u7740 ",(0,d.jsx)(r.code,{children:"5"})," \u5206\u949f\u89e6\u53d1\u4e00\u6b21\uff0c\u800c ",(0,d.jsx)(r.code,{children:"25\uff0c45"})," \u7b49\u5206\u522b\u89e6\u53d1\u4e00\u6b21."]}),"\n",(0,d.jsxs)(r.p,{children:["\uff085\uff09",(0,d.jsx)(r.code,{children:","}),"\uff1a\u8868\u793a\u5217\u51fa\u679a\u4e3e\u503c\u3002\u4f8b\u5982\uff1a\u5728 ",(0,d.jsx)(r.code,{children:"Minutes"})," \u57df\u4f7f\u7528 ",(0,d.jsx)(r.code,{children:"5,20"}),"\uff0c\u5219\u610f\u5473\u7740\u5728 ",(0,d.jsx)(r.code,{children:"5"})," \u548c ",(0,d.jsx)(r.code,{children:"20"})," \u5206\u6bcf\u5206\u949f\u89e6\u53d1\u4e00\u6b21\u3002"]}),"\n",(0,d.jsxs)(r.p,{children:["\uff086\uff09",(0,d.jsx)(r.code,{children:"L"}),"\uff1a\u8868\u793a\u6700\u540e\uff0c\u53ea\u80fd\u51fa\u73b0\u5728 ",(0,d.jsx)(r.code,{children:"DayofWeek"})," \u548c ",(0,d.jsx)(r.code,{children:"DayofMonth"})," \u57df\u3002\u5982\u679c\u5728 ",(0,d.jsx)(r.code,{children:"DayofWeek"})," \u57df\u4f7f\u7528 ",(0,d.jsx)(r.code,{children:"5L"}),",\u610f\u5473\u7740\u5728\u6700\u540e\u7684\u4e00\u4e2a\u661f\u671f\u56db\u89e6\u53d1\u3002"]}),"\n",(0,d.jsxs)(r.p,{children:["\uff087\uff09",(0,d.jsx)(r.code,{children:"W"}),"\uff1a\u8868\u793a\u6709\u6548\u5de5\u4f5c\u65e5(\u5468\u4e00\u5230\u5468\u4e94) \u53ea\u80fd\u51fa\u73b0\u5728 ",(0,d.jsx)(r.code,{children:"DayofMonth"})," \u57df\uff0c\u7cfb\u7edf\u5c06\u5728\u79bb\u6307\u5b9a\u65e5\u671f\u7684\u6700\u8fd1\u7684\u6709\u6548\u5de5\u4f5c\u65e5\u89e6\u53d1\u4e8b\u4ef6\u3002\u4f8b\u5982\uff1a\u5728 ",(0,d.jsx)(r.code,{children:"DayofMonth"})," \u4f7f\u7528 ",(0,d.jsx)(r.code,{children:"5W"}),"\uff0c\u5982\u679c ",(0,d.jsx)(r.code,{children:"5"})," \u65e5\u662f\u661f\u671f\u516d\uff0c\u5219\u5c06\u5728\u6700\u8fd1\u7684\u5de5\u4f5c\u65e5\uff1a\u661f\u671f\u4e94\uff0c\u5373 ",(0,d.jsx)(r.code,{children:"4"})," \u65e5\u89e6\u53d1\u3002\u5982\u679c ",(0,d.jsx)(r.code,{children:"5"})," \u65e5\u662f\u661f\u671f\u5929\uff0c\u5219\u5728 ",(0,d.jsx)(r.code,{children:"6"})," \u65e5(\u5468\u4e00)\u89e6\u53d1\uff1b\u5982\u679c ",(0,d.jsx)(r.code,{children:"5"})," \u65e5\u5728\u661f\u671f\u4e00\u5230\u661f\u671f\u4e94\u4e2d\u7684\u4e00\u5929\uff0c\u5219\u5c31\u5728 ",(0,d.jsx)(r.code,{children:"5"})," \u65e5\u89e6\u53d1\u3002\u53e6\u5916\u4e00\u70b9\uff0c",(0,d.jsx)(r.code,{children:"W"})," \u7684\u6700\u8fd1\u5bfb\u627e\u4e0d\u4f1a\u8de8\u8fc7\u6708\u4efd \u3002"]}),"\n",(0,d.jsxs)(r.p,{children:["\uff088\uff09",(0,d.jsx)(r.code,{children:"LW"}),"\uff1a\u8fd9\u4e24\u4e2a\u5b57\u7b26\u53ef\u4ee5\u8fde\u7528\uff0c\u8868\u793a\u5728\u67d0\u4e2a\u6708\u6700\u540e\u4e00\u4e2a\u5de5\u4f5c\u65e5\uff0c\u5373\u6700\u540e\u4e00\u4e2a\u661f\u671f\u4e94\u3002"]}),"\n",(0,d.jsxs)(r.p,{children:["\uff089\uff09",(0,d.jsx)(r.code,{children:"#"}),"\uff1a\u7528\u4e8e\u786e\u5b9a\u6bcf\u4e2a\u6708\u7b2c\u51e0\u4e2a\u661f\u671f\u51e0\uff0c\u53ea\u80fd\u51fa\u73b0\u5728 ",(0,d.jsx)(r.code,{children:"DayofMonth"})," \u57df\u3002\u4f8b\u5982\u5728 ",(0,d.jsx)(r.code,{children:"4#2"}),"\uff0c\u8868\u793a\u67d0\u6708\u7684\u7b2c\u4e8c\u4e2a\u661f\u671f\u4e09\u3002"]}),"\n",(0,d.jsxs)(r.h3,{id:"2652-\u5e38\u89c1-cron-\u8868\u8fbe\u5f0f",children:["26.5.2 \u5e38\u89c1 ",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f"]}),"\n",(0,d.jsxs)(r.table,{children:[(0,d.jsx)(r.thead,{children:(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.th,{children:"\u8868\u8fbe\u5f0f"}),(0,d.jsx)(r.th,{children:"\u8868\u8fbe\u5f0f\u4ee3\u8868\u542b\u4e49"}),(0,d.jsx)(r.th,{children:"\u683c\u5f0f\u5316"})]})}),(0,d.jsxs)(r.tbody,{children:[(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"* * * * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5206\u949f"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"*/1 * * * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5206\u949f"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0/1 * * * ?"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5206\u949f"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 * * * ?"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5c0f\u65f6"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 0/1 * * ?"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5c0f\u65f6"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 23 ? * MON-FRI"})}),(0,d.jsx)(r.td,{children:"\u665a\u4e0a 11:00\uff0c\u5468\u4e00\u81f3\u5468\u4e94"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"* * * * * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u79d2"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"*/45 * * * * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf 45 \u79d2"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"*/5 * * * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf 5 \u5206\u949f"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0/10 * * * ?"})}),(0,d.jsx)(r.td,{children:"\u6bcf 10 \u5206\u949f"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 */5 * * * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf 5 \u5206\u949f"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"30 11 * * 1-5"})}),(0,d.jsx)(r.td,{children:"\u5468\u4e00\u81f3\u5468\u4e94\u4e0a\u5348 11:30"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"30 11 * * *"})}),(0,d.jsx)(r.td,{children:"11:30"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0-10 11 * * *"})}),(0,d.jsx)(r.td,{children:"\u4e0a\u5348 11:00 \u81f3 11:10 \u4e4b\u95f4\u7684\u6bcf\u4e00\u5206\u949f"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"* * * 3 *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5206\u949f\uff0c\u53ea\u5728 3 \u6708\u4efd"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"* * * 3,6 *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5206\u949f\uff0c\u53ea\u5728 3 \u6708\u548c 6 \u6708"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"30 14,16 * * *"})}),(0,d.jsx)(r.td,{children:"\u4e0b\u5348 02:30 \u5206\u548c 04:30 \u5206"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"30 6,14,16 * * *"})}),(0,d.jsx)(r.td,{children:"\u65e9\u4e0a 06:30\uff0c\u4e0b\u5348 02:30 \u548c 04:30"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"46 9 * * 1"})}),(0,d.jsx)(r.td,{children:"\u65e9\u4e0a 09:46\uff0c\u53ea\u5728\u661f\u671f\u4e00"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"23 12 15 * *"})}),(0,d.jsx)(r.td,{children:"\u4e0b\u5348 12:23\uff0c\u5728\u672c\u6708\u7684\u7b2c 15 \u5929"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"23 12 * JAN *"})}),(0,d.jsx)(r.td,{children:"\u4e0b\u5348 12:23\uff0c\u53ea\u5728 1 \u6708\u4efd"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"23 12 ? JAN *"})}),(0,d.jsx)(r.td,{children:"\u4e0b\u5348 12:23\uff0c\u53ea\u5728 1 \u6708\u4efd"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"23 12 * JAN-FEB *"})}),(0,d.jsx)(r.td,{children:"\u4e0b\u5348 12:23\uff0c1 \u6708\u81f3 2 \u6708"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"23 12 * JAN-MAR *"})}),(0,d.jsx)(r.td,{children:"\u4e0b\u5348 12:23\uff0c1 \u6708\u81f3 3 \u6708"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"23 12 * * SUN"})}),(0,d.jsx)(r.td,{children:"\u4e0b\u5348 12:23\uff0c\u4ec5\u5728\u661f\u671f\u5929"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"*/5 15 * * MON-FRI"})}),(0,d.jsx)(r.td,{children:"\u6bcf 5 \u5206\u949f\uff0c\u4e0b\u5348 0:00 \u81f3 03:59\uff0c\u5468\u4e00\u81f3\u5468\u4e94"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"* * * * MON#3"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5206\u949f\uff0c\u5728\u6708\u7684\u7b2c\u4e09\u4e2a\u661f\u671f\u4e00"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"* * * * 4L"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u4e00\u5206\u949f\uff0c\u5728\u672c\u6708\u7684\u6700\u540e\u4e00\u5929"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"*/5 * L JAN *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u6708\u4e00\u6b21\u6bcf\u6708 5 \u5206\u949f\uff0c\u53ea\u5728 1 \u6708\u4efd"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"30 02 14 * * *"})}),(0,d.jsx)(r.td,{children:"\u4e0b\u5348\u5728 02:02:30"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"5-10 * * * * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5206\u949f\u7684 5-10 \u79d2"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"5-10 30-35 10-12 * * *"})}),(0,d.jsx)(r.td,{children:"10:00 \u81f3 12:00 \u4e4b\u95f4\u7684\u6bcf\u5206\u949f 5-10 \u79d2\uff0c\u6bcf\u5c0f\u65f6 30-35 \u5206\u949f"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"30 */5 * * * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5206\u949f\u7684 30 \u79d2\uff0c\u6bcf\u4e94\u5206\u949f"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 30 10-13 ? * WED,FRI"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5c0f\u65f6\u7684 30 \u5206\u949f\uff0c\u4e0b\u5348 10:00 \u81f3 01:00 \u4e4b\u95f4\uff0c\u4ec5\u5728\u5468\u4e09\u548c\u5468\u4e94"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"10 0/5 * * * ?"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5206\u949f\u7684 10 \u79d2\uff0c\u6bcf 05 \u5206\u949f"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 6 1/1 * ?"})}),(0,d.jsx)(r.td,{children:"\u4e0b\u5348 06:00"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 5 0/1 * * ?"})}),(0,d.jsx)(r.td,{children:"\u4e00\u4e2a\u5c0f\u65f6\u7684 05 \u5206"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 L * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u6708\u6700\u540e\u4e00\u5929\u4e0a\u5348 00\uff1a00"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 L-1 * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u6708\u6700\u540e\u4e00\u5929\u7684\u51cc\u6668 00\uff1a00"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 3W * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u6708\u7b2c 3 \u4e2a\u5de5\u4f5c\u65e5\u4e0a\u5348 00\uff1a00"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 LW * *"})}),(0,d.jsx)(r.td,{children:"\u5728\u6bcf\u6708\u7684\u6700\u540e\u4e00\u4e2a\u5de5\u4f5c\u65e5\uff0c\u4e0a\u5348 00\uff1a00"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 * * 2L"})}),(0,d.jsx)(r.td,{children:"\u672c\u6708\u6700\u540e\u4e00\u4e2a\u661f\u671f\u4e8c\u4e0a\u5348 00\uff1a00"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 * * 6#3"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u6708\u7b2c\u4e09\u4e2a\u661f\u671f\u516d\u4e0a\u5348 00\uff1a00"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 ? 1 MON#1"})}),(0,d.jsx)(r.td,{children:"1 \u6708\u7b2c\u4e00\u4e2a\u661f\u671f\u4e00\u4e0a\u5348 00\uff1a00"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.Standard"})})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 3 * * ?"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5929\u51e0\u70b9\u6267\u884c\u4e00\u6b21"}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"CronFormat.IncludeSeconds"})})]})]})]}),"\n",(0,d.jsxs)(r.h3,{id:"2653-\u5728\u7ebf\u751f\u6210-cron-\u8868\u8fbe\u5f0f",children:["26.5.3 \u5728\u7ebf\u751f\u6210 ",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f"]}),"\n",(0,d.jsx)(r.p,{children:(0,d.jsx)(r.a,{href:"https://cron.qqe2.com/",children:"https://cron.qqe2.com/"})}),"\n",(0,d.jsxs)(r.h3,{id:"2654-macro-\u6807\u8bc6\u7b26",children:["26.5.4 ",(0,d.jsx)(r.code,{children:"Macro"})," \u6807\u8bc6\u7b26"]}),"\n",(0,d.jsxs)(r.p,{children:["\u4e3a\u4e86\u65b9\u4fbf\u5b9a\u4e49 ",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f\uff0c",(0,d.jsx)(r.code,{children:"Furion"})," \u6846\u67b6\u4e5f\u63d0\u4f9b\u4e86\u975e\u5e38\u65b9\u4fbf\u7684\u5360\u4f4d\u7b26\u5b9e\u73b0\u5e38\u7528\u7684\u65f6\u95f4\u683c\u5f0f\uff1a"]}),"\n",(0,d.jsxs)(r.table,{children:[(0,d.jsx)(r.thead,{children:(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.th,{children:"\u5360\u4f4d\u7b26"}),(0,d.jsx)(r.th,{children:"\u5bf9\u5e94\u8868\u8fbe\u5f0f"}),(0,d.jsx)(r.th,{children:"\u5360\u4f4d\u7b26\u4ee3\u8868\u542b\u4e49"})]})}),(0,d.jsxs)(r.tbody,{children:[(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"@every_second"})}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"* * * * * *"})}),(0,d.jsx)(r.td,{children:"\u4e00\u79d2\u949f\u8dd1\u4e00\u6b21"})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"@every_minute"})}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"* * * * *"})}),(0,d.jsx)(r.td,{children:"\u5728\u5206\u949f\u5f00\u59cb\u65f6\u6bcf\u5206\u949f\u8fd0\u884c\u4e00\u6b21"})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"@hourly"})}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 * * * *"})}),(0,d.jsx)(r.td,{children:"\u5728\u5c0f\u65f6\u5f00\u59cb\u65f6\u6bcf\u5c0f\u65f6\u8fd0\u884c\u4e00\u6b21"})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"@daily"})}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 * * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5929\u5348\u591c\u8fd0\u884c\u4e00\u6b21"})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"@midnight"})}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 * * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5929\u5348\u591c\u8fd0\u884c\u4e00\u6b21"})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"@weekly"})}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 * * 0"})}),(0,d.jsx)(r.td,{children:"\u5468\u65e5\u4e0a\u5348\u5348\u591c\u6bcf\u5468\u8fd0\u884c\u4e00\u6b21"})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"@monthly"})}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 1 * *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u6708\u5728\u6bcf\u6708\u7b2c\u4e00\u5929\u7684\u5348\u591c\u8fd0\u884c\u4e00\u6b21"})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"@yearly"})}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 1 1 *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5e74 1 \u6708 1 \u65e5\u5348\u591c\u8fd0\u884c\u4e00\u6b21"})]}),(0,d.jsxs)(r.tr,{children:[(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"@annually"})}),(0,d.jsx)(r.td,{children:(0,d.jsx)(r.code,{children:"0 0 1 1 *"})}),(0,d.jsx)(r.td,{children:"\u6bcf\u5e74 1 \u6708 1 \u65e5\u5348\u591c\u8fd0\u884c\u4e00\u6b21"})]})]})]}),"\n",(0,d.jsxs)(r.h3,{id:"2655-\u4f7f\u7528-cron-\u8868\u8fbe\u5f0f",children:["26.5.5 \u4f7f\u7528 ",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {2,5}",children:'// \u6bcf\u9694 1s \u6267\u884c\r\nSpareTime.Do("* * * * * *", (timer, count) => {\r\n Console.WriteLine("\u73b0\u5728\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n}, cronFormat: CronFormat.IncludeSeconds);\n'})}),"\n",(0,d.jsx)(r.admonition,{title:"\u5173\u4e8e CronFormat",type:"important",children:(0,d.jsxs)(r.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c",(0,d.jsx)(r.code,{children:"Furion"})," \u6846\u67b6\u672a\u542f\u7528\u5bf9 ",(0,d.jsx)(r.code,{children:"\u79d2"})," \u7684\u652f\u6301\uff0c\u5982\u9700\u5f00\u542f\uff0c\u5219\u8bbe\u7f6e ",(0,d.jsx)(r.code,{children:"cronFormat: CronFormat.IncludeSeconds"})," \u5373\u53ef\u3002\u9ed8\u8ba4\u503c\u662f ",(0,d.jsx)(r.code,{children:"cronFormat: CronFormat.Standard"})]})}),"\n",(0,d.jsxs)(r.h3,{id:"2656-\u4f7f\u7528-macro-\u5360\u4f4d\u7b26",children:["26.5.6 \u4f7f\u7528 ",(0,d.jsx)(r.code,{children:"Macro"})," \u5360\u4f4d\u7b26"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {2}",children:'// \u6bcf\u9694 1s \u6267\u884c\r\nSpareTime.Do("@every_second", (timer, count) => {\r\n Console.WriteLine("\u73b0\u5728\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n});\n'})}),"\n",(0,d.jsx)(r.h3,{id:"2657-\u914d\u7f6e\u4efb\u52a1\u4fe1\u606f",children:"26.5.7 \u914d\u7f6e\u4efb\u52a1\u4fe1\u606f"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {4}",children:'SpareTime.Do("* * * * *", (timer, count) => {\r\n Console.WriteLine("\u73b0\u5728\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n}, "cronName", "\u6bcf\u5206\u949f\u6267\u884c\u4e00\u6b21");\n'})}),"\n",(0,d.jsx)(r.h3,{id:"2658-\u624b\u52a8\u542f\u52a8\u6267\u884c",children:"26.5.8 \u624b\u52a8\u542f\u52a8\u6267\u884c"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {4,6}",children:'SpareTime.Do("* * * * *", (timer, count) => {\r\n Console.WriteLine("\u73b0\u5728\u65f6\u95f4\uff1a" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n}, "cronName", "\u6bcf\u5206\u949f\u6267\u884c\u4e00\u6b21", startNow: false);\r\n\r\nSpareTime.Start("cronName");\n'})}),"\n",(0,d.jsxs)(r.h3,{id:"2659-isparetimeworker-\u65b9\u5f0f",children:["26.5.9 ",(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u65b9\u5f0f"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {1,8}",children:'public class JobWorker : ISpareTimeWorker\r\n{\r\n /// <summary>\r\n /// \u6bcf\u5206\u949f\u6267\u884c\r\n /// </summary>\r\n /// <param name="timer"></param>\r\n /// <param name="count"></param>\r\n [SpareTime("* * * * *", "jobName", StartNow = true)]\r\n public void DoSomething(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n }\r\n\r\n /// <summary>\r\n /// \u6bcf\u5206\u949f\u6267\u884c\uff08\u652f\u6301\u5f02\u6b65\uff09\r\n /// </summary>\r\n /// <param name="timer"></param>\r\n /// <param name="count"></param>\r\n [SpareTime("* * * * *", "jobName", StartNow = true)]\r\n public async Task DoSomethingAsync(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n await Task.CompletedTask;\r\n }\r\n}\n'})}),"\n",(0,d.jsx)(r.p,{children:(0,d.jsxs)(r.strong,{children:["\u9700\u8981\u5728 ",(0,d.jsx)(r.code,{children:"Startup.cs"})," \u4e2d\u6ce8\u518c ",(0,d.jsx)(r.code,{children:"services.AddTaskScheduler()"})]})}),"\n",(0,d.jsx)(r.h2,{id:"266-\u81ea\u5b9a\u4e49\u4e0b\u6b21\u6267\u884c\u65f6\u95f4",children:"26.6 \u81ea\u5b9a\u4e49\u4e0b\u6b21\u6267\u884c\u65f6\u95f4"}),"\n",(0,d.jsx)(r.p,{children:"\u6709\u4e9b\u65f6\u5019\u6211\u4eec\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u4e1a\u52a1\u903b\u8f91\uff0c\u6bd4\u5982\u6570\u636e\u5e93\u67e5\u8be2\u7b49\u64cd\u4f5c\u8fd4\u56de\u4e0b\u4e00\u6b21\u6267\u884c\u65f6\u95f4\uff0c\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u65b9\u5f0f\u3002"}),"\n",(0,d.jsx)(r.h3,{id:"2661-\u9ad8\u7ea7\u81ea\u5b9a\u4e49\u95f4\u9694\u65b9\u5f0f",children:"26.6.1 \u9ad8\u7ea7\u81ea\u5b9a\u4e49\u95f4\u9694\u65b9\u5f0f"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {2,4-5,7}",children:'SpareTime.Do(()=>{\r\n // \u8fd9\u91cc\u53ef\u4ee5\u67e5\u8be2\u6570\u636e\u5e93\u6216\u8fdb\u884c\u6216\u8fdb\u884c\u4efb\u4f55\u4e1a\u52a1\u903b\u8f91\r\n\r\n if(\u7b26\u5408\u903b\u8f91){\r\n return 1000; // \u6bcf\u79d2\u6267\u884c\r\n }\r\n else return -1; // \u4e0d\u7b26\u5408\u903b\u8f91\u53d6\u6d88\u4efb\u52a1\r\n},\r\n(timer,count)=>{\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n});\n'})}),"\n",(0,d.jsx)(r.admonition,{title:"\u914d\u7f6e\u662f\u5426\u6301\u7eed\u68c0\u67e5",type:"important",children:(0,d.jsxs)(r.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8be5\u81ea\u5b9a\u4e49\u4f1a\u5728\u8fd4\u56de ",(0,d.jsx)(r.code,{children:"\u5c0f\u4e8e\u6216\u7b49\u4e8e0"})," \u65f6\u7ec8\u6b62\u4efb\u52a1\u7684\u6267\u884c\u3002\u4f46\u662f\u6211\u4eec\u5e0c\u671b\u8be5\u4efb\u52a1\u4e0d\u8981\u7ec8\u6b62\uff0c\u53ea\u8981\u7b26\u5408\u6761\u4ef6\u90fd\u4e00\u76f4\u6267\u884c\uff0c\u53ea\u9700\u8981\u914d\u7f6e ",(0,d.jsx)(r.code,{children:"cancelInNoneNextTime: false"})," \u5373\u53ef"]})}),"\n",(0,d.jsxs)(r.h3,{id:"2662-\u9ad8\u7ea7\u81ea\u5b9a\u4e49-cron-\u8868\u8fbe\u5f0f",children:["26.6.2 \u9ad8\u7ea7\u81ea\u5b9a\u4e49 ",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {2,4-5,7}",children:'SpareTime.Do(()=>{\r\n // \u8fd9\u91cc\u53ef\u4ee5\u67e5\u8be2\u6570\u636e\u5e93\u6216\u8fdb\u884c\u6216\u8fdb\u884c\u4efb\u4f55\u4e1a\u52a1\u903b\u8f91\r\n\r\n if(\u7b26\u5408\u903b\u8f91){\r\n return DateTimeOffset.Now.AddMinutes(10); // \u5341\u5206\u949f\u540e\u518d\u6267\u884c\r\n }\r\n else return null; // \u4e0d\u7b26\u5408\u903b\u8f91\u53d6\u6d88\u4efb\u52a1\r\n},\r\n(timer,count) => {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n});\n'})}),"\n",(0,d.jsxs)(r.admonition,{title:"\u914d\u7f6e\u662f\u5426\u6301\u7eed\u68c0\u67e5",type:"important",children:[(0,d.jsxs)(r.p,{children:["\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8be5\u81ea\u5b9a\u4e49\u4f1a\u5728\u8fd4\u56de ",(0,d.jsx)(r.code,{children:"null"})," \u65f6\u7ec8\u6b62\u4efb\u52a1\u7684\u6267\u884c\u3002\u4f46\u662f\u6211\u4eec\u5e0c\u671b\u8be5\u4efb\u52a1\u4e0d\u8981\u7ec8\u6b62\uff0c\u53ea\u8981\u7b26\u5408\u6761\u4ef6\u90fd\u4e00\u76f4\u6267\u884c\uff0c\u53ea\u9700\u8981\u914d\u7f6e ",(0,d.jsx)(r.code,{children:"cancelInNoneNextTime: false"})," \u5373\u53ef\uff0c\u5982\uff1a"]}),(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {2,4-5,7,12}",children:'SpareTime.Do(()=>{\r\n // \u8fd9\u91cc\u53ef\u4ee5\u67e5\u8be2\u6570\u636e\u5e93\u6216\u8fdb\u884c\u6216\u8fdb\u884c\u4efb\u4f55\u4e1a\u52a1\u903b\u8f91\r\n\r\n if(\u7b26\u5408\u903b\u8f91){\r\n return SpareTime.GetCronNextOccurrence("cron \u8868\u8fbe\u5f0f");\r\n }\r\n else return null; // \u4e0d\u7b26\u5408\u903b\u8f91\u7ee7\u7eed\u68c0\u67e5\r\n},\r\n(timer,count) => {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n}, cancelInNoneNextTime: false);\n'})})]}),"\n",(0,d.jsxs)(r.h2,{id:"267-isparetimeworker-\u8bf4\u660e",children:["26.7 ",(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u8bf4\u660e"]}),"\n",(0,d.jsxs)(r.p,{children:["\u9664\u4e86\u4e0a\u9762\u7684 ",(0,d.jsx)(r.code,{children:"SpareTime"})," \u9759\u6001\u7c7b\u65b9\u5f0f\uff0c",(0,d.jsx)(r.code,{children:"Furion"})," \u6846\u67b6\u8fd8\u63d0\u4f9b\u4e86 ",(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u65b9\u5f0f\uff0c\u4f7f\u7528\u8be5\u65b9\u5f0f\u975e\u5e38\u7b80\u5355\uff0c\u53ea\u9700\u8981\u81ea\u5b9a\u4e49\u4e00\u4e2a",(0,d.jsx)(r.strong,{children:"\u516c\u5f00\u4e14\u975e\u62bd\u8c61\u975e\u9759\u6001"}),"\u7c7b\u5e76\u5b9e\u73b0 ",(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u5373\u53ef\u3002"]}),"\n",(0,d.jsx)(r.p,{children:"\u5728\u8be5\u7c7b\u4e2d\u5b9a\u4e49\u7684\u4efb\u52a1\u65b9\u6cd5\u9700\u6ee1\u8db3\u4ee5\u4e0b\u89c4\u5219\uff1a"}),"\n",(0,d.jsxs)(r.ul,{children:["\n",(0,d.jsxs)(r.li,{children:["\u5fc5\u987b\u662f",(0,d.jsx)(r.strong,{children:"\u516c\u5f00\u4e14\u5b9e\u4f8b\u65b9\u6cd5"})]}),"\n",(0,d.jsxs)(r.li,{children:["\u8be5\u65b9\u6cd5\u5fc5\u987b\u8fd4\u56de ",(0,d.jsx)(r.code,{children:"void"})," \u4e14\u63d0\u4f9b ",(0,d.jsx)(r.code,{children:"SpareTimer"})," \u548c ",(0,d.jsx)(r.code,{children:"long"})," \u4e24\u4e2a\u53c2\u6570"]}),"\n",(0,d.jsxs)(r.li,{children:["\u5fc5\u987b\u8d34\u6709 ",(0,d.jsx)(r.code,{children:"[SpareTime]"})," \u7279\u6027"]}),"\n"]}),"\n",(0,d.jsx)(r.p,{children:"\u5982\uff1a"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {1,4-5,12-13,20-21,28-30,37-38,45}",children:'public class JobWorker : ISpareTimeWorker\r\n{\r\n // \u6bcf\u9694\u4e00\u79d2\u6267\u884c\uff0c\u4e14\u7acb\u5373\u542f\u52a8\r\n [SpareTime(1000, "jobName1", StartNow = true)]\r\n public void DoSomething1(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n }\r\n\r\n // \u6bcf\u5206\u949f\u6267\u884c\uff0c\u4e14\u7acb\u5373\u542f\u52a8\r\n [SpareTime("* * * * *", "jobName2", StartNow = true)]\r\n public void DoSomething2(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n }\r\n\r\n // \u6bcf\u79d2\u6267\u884c\uff0c\u4e14\u7b49\u5f85\u542f\u52a8\r\n [SpareTime("* * * * * *", "jobName3",CronFormat = CronFormat.IncludeSeconds, StartNow = false)]\r\n public void DoSomething3(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n }\r\n\r\n // \u6bcf\u79d2\u6267\u884c\u4e00\u6b21\uff0c\u6bcf\u5206\u949f\u4e5f\u6267\u884c\u4e00\u6b21\r\n [SpareTime(1000, "jobName4", StartNow = true)]\r\n [SpareTime("* * * * *", "jobName5", StartNow = true)]\r\n public void DoSomething4(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n }\r\n\r\n // \u53ea\u6267\u884c\u4e00\u6b21\r\n [SpareTime(1000, "jobName5", StartNow = true, DoOnce = true)]\r\n public void DoSomething5(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n }\r\n\r\n // \u8bfb\u53d6\u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u8fc7 #(\u914d\u7f6e\u8def\u5f84)\r\n [SpareTime("#(MyJob:Time)", "jobName6", StartNow = true, DoOnce = true)]\r\n public void DoSomething5(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n }\r\n\r\n // \u652f\u6301\u5f02\u6b65\r\n [SpareTime(1000, "jobName1", StartNow = true)]\r\n public async Task DoSomethingAsync(SpareTimer timer, long count)\r\n {\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n await Task.CompletedTask;\r\n }\r\n}\n'})}),"\n",(0,d.jsx)(r.admonition,{title:"\u5173\u4e8e\u4f9d\u8d56\u6ce8\u5165",type:"warning",children:(0,d.jsxs)(r.p,{children:[(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u63a5\u53e3\u4e3b\u8981\u662f\u7528\u6765\u67e5\u627e\u5b9a\u65f6\u5668\u5bf9\u8c61\u7684\uff0c\u4e5f\u5c31\u662f\u5b83\u7684\u5b9e\u73b0\u7c7b\u5e76\u672a\u63d0\u4f9b\u4f9d\u8d56\u6ce8\u5165\u529f\u80fd\uff0c\u6240\u4ee5\u5728\u5b9e\u73b0\u7c7b\u5e76\u4e0d\u652f\u6301\u6784\u9020\u51fd\u6570\u6ce8\u5165\u4f9d\u8d56\u9879\u3002"]})}),"\n",(0,d.jsxs)(r.h3,{id:"2671-sparetime-\u7279\u6027",children:["26.7.1 ",(0,d.jsx)(r.code,{children:"[SpareTime]"})," \u7279\u6027"]}),"\n",(0,d.jsxs)(r.p,{children:[(0,d.jsx)(r.code,{children:"[SpareTime]"})," \u652f\u6301\u4ee5\u4e0b\u914d\u7f6e\u5c5e\u6027"]}),"\n",(0,d.jsxs)(r.ul,{children:["\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"Interval"}),"\uff1a\u95f4\u9694\u65f6\u95f4, ",(0,d.jsx)(r.code,{children:"double"})," \u7c7b\u578b"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"CronExpression"}),"\uff1a",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f\uff0c",(0,d.jsx)(r.code,{children:"string"})," \u7c7b\u578b"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"WorkerName"}),"\uff1a\u4efb\u52a1\u552f\u4e00\u6807\u8bc6\uff0c",(0,d.jsx)(r.code,{children:"string"})," \u7c7b\u578b\uff0c",(0,d.jsx)(r.code,{children:"\u5fc5\u586b"})]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"Description"}),"\uff1a\u4efb\u52a1\u63cf\u8ff0\uff0c",(0,d.jsx)(r.code,{children:"string"})," \u7c7b\u578b"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"DoOnce"}),"\uff1a\u662f\u5426\u53ea\u6267\u884c\u4e00\u6b21\uff0c",(0,d.jsx)(r.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,d.jsx)(r.code,{children:"false"})]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"StartNow"}),"\uff1a\u662f\u5426\u7acb\u5373\u542f\u52a8\uff0c\u9ed8\u8ba4 ",(0,d.jsx)(r.code,{children:"false"})]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"CronFormat"}),"\uff1a",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f\u683c\u5f0f\u5316\u65b9\u5f0f\uff0c",(0,d.jsx)(r.code,{children:"CronFormat"})," \u679a\u4e3e\u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,d.jsx)(r.code,{children:"CronFormat.Standard"})]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"ExecuteType"}),"\uff1a\u914d\u7f6e\u4efb\u52a1\u6267\u884c\u65b9\u5f0f\uff0c",(0,d.jsx)(r.code,{children:"SpareTimeExecuteTypes"})," \u679a\u4e3e\u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,d.jsx)(r.code,{children:"SpareTimeExecuteTypes.Parallel"})]}),"\n"]}),"\n",(0,d.jsxs)(r.h2,{id:"268-sparetime-\u9759\u6001\u7c7b",children:["26.8 ",(0,d.jsx)(r.code,{children:"SpareTime"})," \u9759\u6001\u7c7b"]}),"\n",(0,d.jsxs)(r.p,{children:[(0,d.jsx)(r.code,{children:"SpareTime"})," \u9759\u6001\u7c7b\u63d0\u4f9b\u4e86\u4e00\u4e9b\u65b9\u6cd5\u65b9\u4fbf\u521d\u59cb\u5316\u548c\u7ba1\u7406\u4efb\u52a1"]}),"\n",(0,d.jsx)(r.h3,{id:"2681-\u521d\u59cb\u5316\u4efb\u52a1",children:"26.8.1 \u521d\u59cb\u5316\u4efb\u52a1"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers",children:"// \u5f00\u542f\u95f4\u9694\u4efb\u52a1\r\nSpareTime.Do(interval, [options]);\r\n\r\n// \u5f00\u542f Cron \u8868\u8fbe\u5f0f\u4efb\u52a1\r\nSpareTime.Do(expression, [options]);\r\n\r\n// \u53ea\u6267\u884c\u4e00\u6b21\u4efb\u52a1\r\nSpareTime.DoOnce(interval, [options]);\r\n\r\n// \u5b9e\u73b0\u81ea\u5b9a\u4e49\u4efb\u52a1\r\nSpareTime.Do(()=>{\r\n return DateTime.Now.AddMinutes(10);\r\n},[options]);\n"})}),"\n",(0,d.jsx)(r.h3,{id:"2682-\u5b9e\u73b0\u540e\u53f0\u6267\u884c",children:"26.8.2 \u5b9e\u73b0\u540e\u53f0\u6267\u884c"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers",children:"// \u5b9e\u73b0\u540e\u53f0\u6267\u884c\r\nSpareTime.DoIt(()=>{});\n"})}),"\n",(0,d.jsx)(r.h3,{id:"2683-\u5f00\u59cb\u4e00\u4e2a\u4efb\u52a1",children:"26.8.3 \u5f00\u59cb\u4e00\u4e2a\u4efb\u52a1"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers",children:'SpareTime.Start("\u4efb\u52a1\u6807\u8bc6");\n'})}),"\n",(0,d.jsx)(r.h3,{id:"2684-\u6682\u505c\u4e00\u4e2a\u4efb\u52a1",children:"26.8.4 \u6682\u505c\u4e00\u4e2a\u4efb\u52a1"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers",children:'SpareTime.Stop("\u4efb\u52a1\u6807\u8bc6");\r\n// \u8fd8\u53ef\u4ee5\u6807\u8bb0\u4e00\u4e2a\u4efb\u52a1\u6267\u884c\u5931\u8d25\r\nSpareTime.Stop("\u4efb\u52a1\u6807\u8bc6", true);\n'})}),"\n",(0,d.jsx)(r.h3,{id:"2685-\u53d6\u6d88\u4e00\u4e2a\u4efb\u52a1",children:"26.8.5 \u53d6\u6d88\u4e00\u4e2a\u4efb\u52a1"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers",children:'SpareTime.Cancel("\u4efb\u52a1\u540d\u79f0");\n'})}),"\n",(0,d.jsx)(r.h3,{id:"2686-\u9500\u6bc1\u6240\u6709\u4efb\u52a1",children:"26.8.6 \u9500\u6bc1\u6240\u6709\u4efb\u52a1"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers",children:"SpareTime.Dispose();\n"})}),"\n",(0,d.jsx)(r.h3,{id:"2687-\u83b7\u53d6\u6240\u6709\u4efb\u52a1",children:"26.8.7 \u83b7\u53d6\u6240\u6709\u4efb\u52a1"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers",children:"var workers = SpareTime.GetWorkers();\n"})}),"\n",(0,d.jsx)(r.h3,{id:"2688-\u83b7\u53d6\u5355\u4e2a\u4efb\u52a1",children:"26.8.8 \u83b7\u53d6\u5355\u4e2a\u4efb\u52a1"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers",children:'var worker = SpareTime.GetWorker("workerName");\n'})}),"\n",(0,d.jsxs)(r.h3,{id:"2689-\u89e3\u6790-cron-\u8868\u8fbe\u5f0f",children:["26.8.9 \u89e3\u6790 ",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers",children:'var nextTime = SpareTime.GetCronNextOccurrence("* * * * *");\n'})}),"\n",(0,d.jsxs)(r.h2,{id:"269-\u5e76\u884c\u548c\u4e32\u884c\u6267\u884c\u65b9\u5f0f",children:["26.9 ",(0,d.jsx)(r.code,{children:"\u5e76\u884c"}),"\u548c",(0,d.jsx)(r.code,{children:"\u4e32\u884c"}),"\u6267\u884c\u65b9\u5f0f"]}),"\n",(0,d.jsxs)(r.p,{children:[(0,d.jsx)(r.code,{children:"Furion"})," \u6846\u67b6\u63d0\u4f9b\u4e86\u4efb\u52a1\u4e24\u79cd\u6267\u884c\u65b9\u5f0f ",(0,d.jsx)(r.code,{children:"\u5e76\u884c"})," \u548c ",(0,d.jsx)(r.code,{children:"\u4e32\u884c"}),"\uff1a"]}),"\n",(0,d.jsxs)(r.ul,{children:["\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"\u5e76\u884c"}),"\uff1a\u65e0\u9700\u7b49\u5f85\u4e0a\u4e00\u6b21\u4efb\u52a1\u5b8c\u6210\uff0c",(0,d.jsx)(r.strong,{children:"\u9ed8\u8ba4\u503c"})]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"\u4e32\u884c"}),"\uff1a\u9700\u7b49\u5f85\u4e0a\u4e00\u6b21\u4efb\u52a1\u5b8c\u6210"]}),"\n"]}),"\n",(0,d.jsxs)(r.h3,{id:"2691-sparetime-\u9759\u6001\u65b9\u5f0f\u6307\u5b9a",children:["26.9.1 ",(0,d.jsx)(r.code,{children:"SpareTime"})," \u9759\u6001\u65b9\u5f0f\u6307\u5b9a"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {3,5}",children:'SpareTime.Do(1000, (t, i) =>\r\n{\r\n Thread.Sleep(5000); // \u6a21\u62df\u6267\u884c\u8017\u65f6\u4efb\u52a1\r\n Console.WriteLine($"{t.WorkerName} -{t.Description} - {DateTime.Now:yyyy-MM-dd HH:mm:ss} - {i}");\r\n}, "serialName", "\u6a21\u62df\u4e32\u884c\u4efb\u52a1", executeType: SpareTimeExecuteTypes.Serial);\n'})}),"\n",(0,d.jsxs)(r.h3,{id:"2692-isparetimeworker-\u65b9\u5f0f",children:["26.9.2 ",(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u65b9\u5f0f"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {1}",children:'[SpareTime(1000, "jobName1", StartNow = true, ExecuteType = SpareTimeExecuteTypes.Serial)]\r\npublic void DoSomething1(SpareTimer timer, long count)\r\n{\r\n Console.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));\r\n Console.WriteLine($"\u4e00\u5171\u6267\u884c\u4e86\uff1a{count} \u6b21");\r\n}\n'})}),"\n",(0,d.jsx)(r.h2,{id:"2610-\u4efb\u52a1\u5f02\u5e38\u5904\u7406",children:"26.10 \u4efb\u52a1\u5f02\u5e38\u5904\u7406"}),"\n",(0,d.jsxs)(r.p,{children:["\u6709\u4e9b\u65f6\u5019\u6211\u4eec\u53ef\u80fd\u5728\u6267\u884c\u4efb\u52a1\u8fc7\u7a0b\u4e2d\u51fa\u73b0\u5f02\u5e38\uff0c",(0,d.jsx)(r.code,{children:"Furion"})," \u4e5f\u63d0\u4f9b\u4e86\u5c5e\u6027\u5224\u65ad\u662f\u5426\u6709\u5f02\u5e38\u548c\u5f02\u5e38\u4fe1\u606f\uff0c\u65b9\u4fbf\u8bb0\u5f55\u5230\u65e5\u5fd7\u4e2d\uff0c\u5982\uff1a"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {4-7,11}",children:'SpareTime.Do(1000, (t, c) =>\r\n{\r\n // \u5224\u65ad\u662f\u5426\u6709\u5f02\u5e38\r\n if (t.Exception.Any())\r\n {\r\n Console.WriteLine(t.Exception.Values.LastOrDefault()?.Message);\r\n }\r\n // \u6267\u884c\u7b2c\u4e09\u6b21\u629b\u5f02\u5e38\r\n if (c > 2)\r\n {\r\n throw Oops.Oh("\u629b\u5f02\u5e38" + c);\r\n }\r\n else\r\n {\r\n Console.WriteLine($"{t.WorkerName} -{t.Description} - {DateTime.Now:yyyy-MM-dd HH:mm:ss} - {c}");\r\n }\r\n}, "exceptionJob");\n'})}),"\n",(0,d.jsx)(r.admonition,{title:"\u7279\u522b\u8bf4\u660e",type:"warning",children:(0,d.jsxs)(r.p,{children:["\u5982\u679c\u4e00\u4e2a\u4efb\u52a1\u8fde\u7eed\u9519\u8bef\u6b21\u6570\u8fbe ",(0,d.jsx)(r.code,{children:"10\u6b21"})," \u5219\u4efb\u52a1\u5c06\u81ea\u52a8\u505c\u6b62\uff0c\u5e76\u6807\u8bb0\u4efb\u52a1\u72b6\u6001\u4e3a ",(0,d.jsx)(r.code,{children:"Failed"}),"\u3002"]})}),"\n",(0,d.jsx)(r.h2,{id:"2611-\u5982\u4f55\u5728\u4efb\u52a1\u4e2d\u89e3\u6790\u5bf9\u8c61",children:"26.11 \u5982\u4f55\u5728\u4efb\u52a1\u4e2d\u89e3\u6790\u5bf9\u8c61"}),"\n",(0,d.jsx)(r.p,{children:"\u6709\u4e9b\u65f6\u5019\u6211\u4eec\u9700\u8981\u5728\u4efb\u52a1\u4e2d\u8fdb\u884c\u6570\u636e\u5e93\u64cd\u4f5c\u6216\u89e3\u6790\u670d\u52a1\uff0c\u8fd9\u65f6\u5019\u6211\u4eec\u53ea\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u4f5c\u7528\u57df\u5373\u53ef"}),"\n",(0,d.jsxs)(r.h3,{id:"26111-sparetime-\u9759\u6001\u7c7b\u4e2d",children:["26.11.1 ",(0,d.jsx)(r.code,{children:"SpareTime"})," \u9759\u6001\u7c7b\u4e2d"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {2}",children:'SpareTime.Do(1000, (timer,count) => {\r\n Scoped.Create((_, scope) =>\r\n {\r\n var services = scope.ServiceProvider;\r\n\r\n // \u83b7\u53d6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\r\n var dbContext = Db.GetDbContext(services);\r\n\r\n // \u83b7\u53d6\u4ed3\u50a8\r\n var respository = Db.GetRepository<Person>(services);\r\n\r\n // \u89e3\u6790\u5176\u4ed6\u670d\u52a1\r\n var otherService = services.GetService<XXX>();\r\n var otherService2 = App.GetService<XXX>(services);\r\n });\r\n}, "\u4efb\u52a1\u6807\u8bc6");\n'})}),"\n",(0,d.jsxs)(r.h3,{id:"26112-isparetimeworker-\u65b9\u5f0f",children:["26.11.2 ",(0,d.jsx)(r.code,{children:"ISpareTimeWorker"})," \u65b9\u5f0f"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {4}",children:'[SpareTime(1000, "jobName1", StartNow = true, ExecuteType = SpareTimeExecuteTypes.Serial)]\r\npublic void DoSomething1(SpareTimer timer, long count)\r\n{\r\n Scoped.Create((_, scope) =>\r\n {\r\n var services = scope.ServiceProvider;\r\n\r\n // \u83b7\u53d6\u6570\u636e\u5e93\u4e0a\u4e0b\u6587\r\n var dbContext = Db.GetDbContext(services);\r\n\r\n // \u83b7\u53d6\u4ed3\u50a8\r\n var respository = Db.GetRepository<Person>(services);\r\n\r\n // \u89e3\u6790\u5176\u4ed6\u670d\u52a1\r\n var otherService = services.GetService<XXX>();\r\n var otherService2 = App.GetService<XXX>(services);\r\n });\r\n}\n'})}),"\n",(0,d.jsx)(r.admonition,{title:"\u6570\u636e\u5e93\u64cd\u4f5c\u6ce8\u610f",type:"important",children:(0,d.jsxs)(r.p,{children:["\u5982\u679c\u4f5c\u7528\u57df\u4e2d\u5bf9",(0,d.jsx)(r.strong,{children:"\u6570\u636e\u5e93\u6709\u4efb\u4f55\u53d8\u66f4\u64cd\u4f5c"}),"\uff0c\u9700\u624b\u52a8\u8c03\u7528 ",(0,d.jsx)(r.code,{children:"SaveChanges"})," \u6216\u5e26 ",(0,d.jsx)(r.code,{children:"Now"})," \u7ed3\u5c3e\u7684\u65b9\u6cd5\u3002\u4e5f\u53ef\u4ee5\u4f7f\u7528 ",(0,d.jsx)(r.code,{children:"Scoped.CreateUow(handler)"})," \u4ee3\u66ff\u3002"]})}),"\n",(0,d.jsxs)(r.h2,{id:"2612-\u5728-backgroundservice-\u4e2d\u4f7f\u7528",children:["26.12 \u5728 ",(0,d.jsx)(r.code,{children:"BackgroundService"})," \u4e2d\u4f7f\u7528"]}),"\n",(0,d.jsxs)(r.p,{children:[(0,d.jsx)(r.code,{children:"BackgroundService"})," \u662f ",(0,d.jsx)(r.code,{children:".NET Core 3"})," \u4e4b\u540e\u63d0\u4f9b\u7684\u8f7b\u91cf\u7ea7\u540e\u53f0\u4efb\u52a1\uff0c\u540c\u65f6\u53ef\u4ee5\u53d1\u5e03\u5230 ",(0,d.jsx)(r.code,{children:"Windows"})," \u670d\u52a1\u548c ",(0,d.jsx)(r.code,{children:"Linux"})," \u5b88\u62a4\u8fdb\u7a0b\u4e2d\u3002"]}),"\n",(0,d.jsx)(r.h3,{id:"26121-\u95f4\u9694\u6267\u884c\u65b9\u5f0f",children:"26.12.1 \u95f4\u9694\u6267\u884c\u65b9\u5f0f"}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {7,18,20,30}",children:'namespace WorkerService;\r\n\r\npublic class Worker : BackgroundService\r\n{\r\n private readonly ILogger<Worker> _logger;\r\n\r\n private const int delay = 1000;\r\n\r\n public Worker(ILogger<Worker> logger)\r\n {\r\n _logger = logger;\r\n }\r\n\r\n protected override async Task ExecuteAsync(CancellationToken stoppingToken)\r\n {\r\n while (!stoppingToken.IsCancellationRequested)\r\n {\r\n var taskFactory = new TaskFactory(System.Threading.Tasks.TaskScheduler.Current);\r\n\r\n await taskFactory.StartNew(async () =>\r\n {\r\n // \u4f60\u7684\u4e1a\u52a1\u4ee3\u7801\u5199\u5230\u8fd9\u91cc\u9762\r\n\r\n _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);\r\n\r\n await Task.CompletedTask;\r\n\r\n }, stoppingToken);\r\n\r\n await Task.Delay(delay, stoppingToken);\r\n }\r\n }\r\n}\n'})}),"\n",(0,d.jsxs)(r.h3,{id:"26122-cron-\u8868\u8fbe\u5f0f\u6267\u884c\u65b9\u5f0f",children:["26.12.2 ",(0,d.jsx)(r.code,{children:"Cron"})," \u8868\u8fbe\u5f0f\u6267\u884c\u65b9\u5f0f"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {9,14,21,23,32}",children:'using Furion.TimeCrontab;\r\n\r\nnamespace WorkerService;\r\n\r\npublic class Worker : BackgroundService\r\n{\r\n private readonly ILogger<Worker> _logger;\r\n\r\n private readonly Crontab _crontab;\r\n\r\n public Worker(ILogger<Worker> logger)\r\n {\r\n _logger = logger;\r\n _crontab = Crontab.Parse("* * * * * *", CronStringFormat.WithSeconds);\r\n }\r\n\r\n protected override async Task ExecuteAsync(CancellationToken stoppingToken)\r\n {\r\n while (!stoppingToken.IsCancellationRequested)\r\n {\r\n var taskFactory = new TaskFactory(System.Threading.Tasks.TaskScheduler.Current);\r\n\r\n await taskFactory.StartNew(async () =>\r\n {\r\n // \u4f60\u7684\u4e1a\u52a1\u4ee3\u7801\u5199\u5230\u8fd9\u91cc\u9762\r\n\r\n _logger.LogInformation("Worker running at: {time}", DateTimeOffset.Now);\r\n\r\n await Task.CompletedTask;\r\n }, stoppingToken);\r\n\r\n await Task.Delay(_crontab.GetSleepMilliseconds(DateTime.UtcNow), stoppingToken);\r\n }\r\n }\r\n}\n'})}),"\n",(0,d.jsx)(r.h2,{id:"2613-\u5b9a\u65f6\u4efb\u52a1\u76d1\u542c\u5668",children:"26.13 \u5b9a\u65f6\u4efb\u52a1\u76d1\u542c\u5668"}),"\n",(0,d.jsxs)(r.p,{children:["\u5728 ",(0,d.jsx)(r.code,{children:"Furion v2.18+"})," \u7248\u672c\u4e4b\u540e\u65b0\u589e\u4e86\u5b9a\u65f6\u4efb\u52a1\u76d1\u542c\u5668 ",(0,d.jsx)(r.code,{children:"ISpareTimeListener"}),"\uff0c\u901a\u8fc7\u76d1\u542c\u5668\u53ef\u4ee5\u5b9e\u73b0\u6240\u6709\u5b9a\u65f6\u4efb\u52a1\u7684\u72b6\u6001\u3002\u5982\uff0c\u521b\u5efa\u4e00\u4e2a ",(0,d.jsx)(r.code,{children:"\u5355\u4f8b"})," \u7684\u76d1\u542c\u5668 ",(0,d.jsx)(r.code,{children:"SpareTimeListener"}),"\uff1a"]}),"\n",(0,d.jsx)(r.pre,{children:(0,d.jsx)(r.code,{className:"language-cs",metastring:"showLineNumbers {8,15}",children:'using Furion.DependencyInjection;\r\nusing Furion.TaskScheduler;\r\nusing System;\r\nusing System.Threading.Tasks;\r\n\r\nnamespace Furion.Core\r\n{\r\n public class SpareTimeListener : ISpareTimeListener, ISingleton\r\n {\r\n /// <summary>\r\n /// \u76d1\u542c\u6240\u6709\u4efb\u52a1\r\n /// </summary>\r\n /// <param name="executer"></param>\r\n /// <returns></returns>\r\n public Task OnListener(SpareTimerExecuter executer)\r\n {\r\n switch (executer.Status)\r\n {\r\n // \u6267\u884c\u5f00\u59cb\u901a\u77e5\r\n case 0:\r\n Console.WriteLine($"{executer.Timer.WorkerName} \u4efb\u52a1\u5f00\u59cb\u901a\u77e5");\r\n break;\r\n // \u4efb\u52a1\u6267\u884c\u4e4b\u524d\u901a\u77e5\r\n case 1:\r\n Console.WriteLine($"{executer.Timer.WorkerName} \u6267\u884c\u4e4b\u524d\u901a\u77e5");\r\n break;\r\n // \u6267\u884c\u6210\u529f\u901a\u77e5\r\n case 2:\r\n Console.WriteLine($"{executer.Timer.WorkerName} \u6267\u884c\u6210\u529f\u901a\u77e5");\r\n break;\r\n // \u4efb\u52a1\u6267\u884c\u5931\u8d25\u901a\u77e5\r\n case 3:\r\n Console.WriteLine($"{executer.Timer.WorkerName} \u6267\u884c\u5931\u8d25\u901a\u77e5");\r\n break;\r\n // \u4efb\u52a1\u6267\u884c\u505c\u6b62\u901a\u77e5\r\n case -1:\r\n Console.WriteLine($"{executer.Timer.WorkerName} \u6267\u884c\u505c\u6b62\u901a\u77e5");\r\n break;\r\n // \u4efb\u52a1\u6267\u884c\u53d6\u6d88\u901a\u77e5\r\n case -2:\r\n Console.WriteLine($"{executer.Timer.WorkerName} \u6267\u884c\u53d6\u6d88\u901a\u77e5");\r\n break;\r\n default:\r\n break;\r\n }\r\n\r\n return Task.CompletedTask;\r\n }\r\n }\r\n}\n'})}),"\n",(0,d.jsxs)(r.h3,{id:"26131-sparetimerexecuter-\u5c5e\u6027\u8bf4\u660e",children:["26.13.1 ",(0,d.jsx)(r.code,{children:"SpareTimerExecuter"})," \u5c5e\u6027\u8bf4\u660e"]}),"\n",(0,d.jsxs)(r.ul,{children:["\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"Timer"}),"\uff1a",(0,d.jsx)(r.code,{children:"SpareTimer"})," \u5b9a\u65f6\u5668\u5bf9\u8c61"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"Status"}),"\uff1a\u76d1\u542c\u72b6\u6001","\n",(0,d.jsxs)(r.ul,{children:["\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"0"}),"\uff1a\u4efb\u52a1\u5f00\u59cb"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"1"}),"\uff1a\u6267\u884c\u4e4b\u524d"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"2"}),"\uff1a\u6267\u884c\u6210\u529f"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"3"}),"\uff1a\u6267\u884c\u5931\u8d25"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"-1"}),"\uff1a\u4efb\u52a1\u505c\u6b62"]}),"\n",(0,d.jsxs)(r.li,{children:[(0,d.jsx)(r.code,{children:"-2"}),"\uff1a\u4efb\u52a1\u53d6\u6d88"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,d.jsx)(r.h2,{id:"2614-iis-\u90e8\u7f72\u56de\u6536\u8bbe\u7f6e",children:"26.14 IIS \u90e8\u7f72\u56de\u6536\u8bbe\u7f6e"}),"\n",(0,d.jsxs)(r.p,{children:["\u5982\u679c\u5728\u9879\u76ee\u4e2d\u4f7f\u7528\u4e86\u5b9a\u65f6\u4efb\u52a1\u4e14\u90e8\u7f72\u5230 ",(0,d.jsx)(r.code,{children:"IIS"})," \u4e2d\uff0c\u90a3\u4e48\u9700\u8981\u8bbe\u7f6e ",(0,d.jsx)(r.code,{children:"IIS"})," \u7981\u6b62\u56de\u6536\uff0c",(0,d.jsxs)(r.a,{href:"/docs/deploy-iis#3415-iis-%E5%9B%9E%E6%94%B6%E9%97%AE%E9%A2%98%E5%92%8C%E9%85%8D%E7%BD%AE",children:["\u70b9\u51fb\u67e5\u770b ",(0,d.jsx)(r.code,{children:"IIS"})," \u56de\u6536\u95ee\u9898\u89e3\u51b3\u65b9\u6848"]})]}),"\n",(0,d.jsx)(r.admonition,{title:"\u90e8\u7f72\u5efa\u8bae",type:"warning",children:(0,d.jsxs)(r.p,{children:["\u5efa\u8bae\u5b9a\u65f6\u4efb\u52a1\u91c7\u7528 ",(0,d.jsx)(r.code,{children:"Worker Service"})," \u72ec\u7acb\u90e8\u7f72\u65b9\u5f0f\uff0c\u4e0d\u5e94\u4f9d\u6258 ",(0,d.jsx)(r.code,{children:"Web"})," \u9879\u76ee\u8fdb\u7a0b\u4e2d\u3002",(0,d.jsx)(r.a,{href:"/docs/process-service",children:"\u67e5\u770b\u3010 Worker Service\u3011\u7ae0\u8282"})]})}),"\n",(0,d.jsx)(r.h2,{id:"2615-\u53cd\u9988\u4e0e\u5efa\u8bae",children:"26.15 \u53cd\u9988\u4e0e\u5efa\u8bae"}),"\n",(0,d.jsx)(r.admonition,{title:"\u4e0e\u6211\u4eec\u4ea4\u6d41",type:"note",children:(0,d.jsxs)(r.p,{children:["\u7ed9 Furion \u63d0 ",(0,d.jsx)(r.a,{href:"https://gitee.com/dotnetchina/Furion/issues/new?issue",children:"Issue"}),"\u3002"]})})]})}function a(e={}){const{wrapper:r}={...(0,i.a)(),...e.components};return r?(0,d.jsx)(r,{...e,children:(0,d.jsx)(h,{...e})}):h(e)}},1151:(e,r,n)=>{n.d(r,{Z:()=>o,a:()=>c});var d=n(7294);const i={},s=d.createContext(i);function c(e){const r=d.useContext(s);return d.useMemo((function(){return"function"==typeof e?e(r):{...r,...e}}),[r,e])}function o(e){let r;return r=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:c(e.components),d.createElement(s.Provider,{value:r},e.children)}}}]); |