修正部分BUG,增加启动错误捕捉
This commit is contained in:
parent
9a6dcd2d30
commit
a6287def20
@ -30,7 +30,17 @@ namespace TrainInfomationProviderService
|
||||
public static void WebLoader()
|
||||
{
|
||||
RouteTable.Routes.MapRoute("traintransit", "tt/{action}/{id}", new { area = "", controller = "Transit", id = UrlParameter.Optional }, new { action = "(keepalive|ls|ss|tor|dt)" }, new[] { "TrainInfomationProviderService.Web" });
|
||||
Task.Run(() => Main(new string[0]));
|
||||
Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Main(new string[0]);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
File.WriteAllText(HostingEnvironment.MapPath("~/err.log"), ex.ToString());
|
||||
}
|
||||
});
|
||||
|
||||
var keepAliveUrl = ConfigurationManager.AppSettings["12306_keepaliveurl"];
|
||||
if (!string.IsNullOrEmpty(keepAliveUrl))
|
||||
|
@ -65,7 +65,7 @@ namespace TrainInfomationProviderService.TrainInfo.Entities
|
||||
//load data
|
||||
var store = TrainInfoManager.Instance.DataStore.TrainData;
|
||||
|
||||
Trains = HashStore.Select(s => store[s]).ToList();
|
||||
Trains = HashStore.Select(s => store.GetValue(s)).ExceptNull().ToList();
|
||||
TrainsCodeMap = Trains.GroupBy(s => s.Code).ToDictionary(s => s.Key, s =>
|
||||
{
|
||||
var arr = s.ToArray();
|
||||
|
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using FSLib.MvcWeb;
|
||||
using Newtonsoft.Json;
|
||||
@ -29,6 +30,15 @@ namespace TrainInfomationProviderService.Web.Controllers
|
||||
|
||||
#endregion
|
||||
|
||||
[ActionName("ls2")]
|
||||
public ActionResult LogSameStation2(string data)
|
||||
{
|
||||
if (string.IsNullOrEmpty(data))
|
||||
return null;
|
||||
|
||||
return LogSameStation(Encoding.UTF8.GetString(Convert.FromBase64String(data)));
|
||||
}
|
||||
|
||||
[ActionName("ls")]
|
||||
public ActionResult LogSameStation(string data)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user