|
|
@@ -1,15 +1,12 @@
|
|
1
|
1
|
using CallCenter.QuartzService;
|
|
2
|
2
|
using CallCenter.Utility;
|
|
3
|
3
|
using CallCenterApi.Common;
|
|
4
|
|
-using CallCenterApi.Interface.Models.Common;
|
|
5
|
4
|
using System;
|
|
6
|
5
|
using System.Collections.Generic;
|
|
7
|
|
-using System.Linq;
|
|
|
6
|
+using System.Threading.Tasks;
|
|
8
|
7
|
using System.Web;
|
|
9
|
8
|
using System.Web.Mvc;
|
|
10
|
9
|
using System.Web.Routing;
|
|
11
|
|
-using System.Web.Script.Serialization;
|
|
12
|
|
-using System.Web.Security;
|
|
13
|
10
|
|
|
14
|
11
|
namespace CallCenterApi.Interface
|
|
15
|
12
|
{
|
|
|
@@ -22,15 +19,25 @@ namespace CallCenterApi.Interface
|
|
22
|
19
|
RouteConfig.RegisterRoutes(RouteTable.Routes);
|
|
23
|
20
|
//clq 增加异常日志记录 自定义 HandleErrorAttribute
|
|
24
|
21
|
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
|
|
25
|
|
- if (!CommonHelper.PortInUse(Int32.Parse(Configs.GetValue("quartz_port"))))
|
|
|
22
|
+
|
|
|
23
|
+ int port = Int32.Parse(Configs.GetValue("quartz_port"));
|
|
|
24
|
+ Task.Run(() =>
|
|
26
|
25
|
{
|
|
27
|
|
- _worker = new QuartzWorker();
|
|
28
|
|
- _worker.AddWork(new SatisfactionClose());
|
|
29
|
|
- _worker.AddWork(new ZhengWuDuiJie());
|
|
30
|
|
- _worker.AddWork(new Peoplewebsite());
|
|
31
|
|
- //_worker.AddWork(new PushWorkorder());
|
|
32
|
|
- _worker.Start();
|
|
33
|
|
- }
|
|
|
26
|
+ Task.Delay(TimeSpan.FromMinutes(1)).Wait();
|
|
|
27
|
+ if (!CommonHelper.PortInUse(port))
|
|
|
28
|
+ {
|
|
|
29
|
+ _worker = new QuartzWorker(port);
|
|
|
30
|
+ _worker.AddWork(new SatisfactionClose());
|
|
|
31
|
+ _worker.AddWork(new ZhengWuDuiJie());
|
|
|
32
|
+ _worker.AddWork(new Peoplewebsite());
|
|
|
33
|
+ //_worker.AddWork(new PushWorkorder());
|
|
|
34
|
+ _worker.Start();
|
|
|
35
|
+ }
|
|
|
36
|
+
|
|
|
37
|
+ }).ContinueWith(p =>
|
|
|
38
|
+ {
|
|
|
39
|
+ System.Diagnostics.Debug.WriteLine(DateTime.Now);
|
|
|
40
|
+ });
|
|
34
|
41
|
}
|
|
35
|
42
|
protected void Application_End()
|
|
36
|
43
|
{
|