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.

52 lines
1.5 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using Server.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Utils;
namespace Server.ConsoleHost
{
class Program
{
static void Main(string[] args)
{
int errCode = 0;
if (SvrManager.StartAllService(out errCode))
{
Console.WriteLine("服务启动成功!");
}
else
{
Console.WriteLine(errCode);
}
//定时器
double time_11 = AppSettingsHelper.GetIntByKey("Time11", 2) * 60 * 1000;//60分钟
System.Timers.Timer time11 = new System.Timers.Timer();
time11.Enabled = true;
time11.Interval = time_11;
time11.Start();
time11.Elapsed += new System.Timers.ElapsedEventHandler(OneHoursEvent);
Console.ReadLine();
}
private static void OneHoursEvent(object sender, System.Timers.ElapsedEventArgs e)
{
//触发事件时间的小时如01:30:00触发事件则这里获取到1
LogHelper.Log.WriteInfo("预备");
int intHour = e.SignalTime.Hour;
if (intHour == 10 && e.SignalTime.Minute<33)
{
LogHelper.Log.WriteInfo("开始同步基金数据");
DataSync.DataSyncService.Instance.Initialize();
}
}
}
}