개정판 150747cb
issue #0001: ServiceStation db 접속 불가시 종료현상 수정
Change-Id: I2eb4839e429fdbb65c3491ff40cdbe39f7d1bce1
ConvertService/ServiceBase/Markus.Service.Extensions/Helper/ConfigHelper.cs | ||
---|---|---|
12 | 12 |
{ |
13 | 13 |
public static ConfigParser AppConfig(string ConfigFileName) |
14 | 14 |
{ |
15 |
string startDir = AppDomain.CurrentDomain.BaseDirectory;
|
|
16 |
string configFilePath = "";
|
|
15 |
var startDir = AppDomain.CurrentDomain.BaseDirectory;
|
|
16 |
var configFilePath = $"{System.IO.Path.Combine(startDir, ConfigFileName)}";
|
|
17 | 17 |
|
18 |
if (!System.IO.Path.IsPathRooted(ConfigFileName)) |
|
19 |
{ |
|
20 |
configFilePath = $"{System.IO.Path.Combine(startDir, ConfigFileName)}"; |
|
21 |
} |
|
22 |
else |
|
23 |
{ |
|
24 |
configFilePath = ConfigFileName; |
|
25 |
} |
|
26 |
|
|
27 |
if(!System.IO.File.Exists(configFilePath)) |
|
18 |
if (!System.IO.File.Exists(configFilePath)) |
|
28 | 19 |
{ |
29 | 20 |
throw new Exception($"Config File Not Found. {configFilePath}"); |
30 | 21 |
} |
31 | 22 |
|
32 |
return new ConfigParser(configFilePath,
|
|
23 |
return new ConfigParser(configFilePath, |
|
33 | 24 |
new ConfigParserSettings |
34 | 25 |
{ |
35 | 26 |
MultiLineValues = MultiLineValues.Simple | MultiLineValues.AllowValuelessKeys | MultiLineValues.QuoteDelimitedValues, |
ConvertService/ServiceBase/Markus.Service.Station/ServiceStation.cs | ||
---|---|---|
81 | 81 |
configFileName = $"{typeof(ServiceStation).Name}.ini"; |
82 | 82 |
config = ConfigHelper.AppConfig(this.configFileName); |
83 | 83 |
} |
84 |
catch (Exception) |
|
84 |
catch (Exception ex)
|
|
85 | 85 |
{ |
86 |
throw new Exception("Config Read Error."); |
|
86 |
throw new Exception("Config Read Error.", ex);
|
|
87 | 87 |
} |
88 | 88 |
|
89 | 89 |
if (config != null) |
... | ... | |
400 | 400 |
} |
401 | 401 |
|
402 | 402 |
|
403 |
if ((DateTime.Now - logTime) >= new TimeSpan(0, 5, 0))
|
|
403 |
if ((DateTime.Now - logTime) >= new TimeSpan(0, 5,0)) |
|
404 | 404 |
{ |
405 | 405 |
logTime = DateTime.Now; |
406 | 406 |
logger.Info("StationService Alive Check"); |
ConvertService/ServiceBase/Markus.Service.Station/StationService/ServiceStationTask.cs | ||
---|---|---|
298 | 298 |
/// </summary> |
299 | 299 |
private async void CleanUpDataBaseItems() |
300 | 300 |
{ |
301 |
using (DataBase.ConvertDatabase database = new DataBase.ConvertDatabase(MarkusDBConnectionString))
|
|
301 |
try
|
|
302 | 302 |
{ |
303 |
var items = database.GetConvertingItems(RunProjectList); |
|
303 |
using (DataBase.ConvertDatabase database = new DataBase.ConvertDatabase(MarkusDBConnectionString)) |
|
304 |
{ |
|
305 |
var items = database.GetConvertingItems(RunProjectList); |
|
304 | 306 |
|
305 |
List< WcfClient.StationServiceTask.ConvertItem> aliveItems = new List<WcfClient.StationServiceTask.ConvertItem>(); |
|
307 |
List< WcfClient.StationServiceTask.ConvertItem> aliveItems = new List<WcfClient.StationServiceTask.ConvertItem>();
|
|
306 | 308 |
|
307 |
try |
|
308 |
{ |
|
309 | 309 |
foreach (var item in StationServiceList.Where(x => x.IsOnline)) |
310 | 310 |
{ |
311 | 311 |
var serviceItems = await item.Service.AliveConvertListAsync(); |
... | ... | |
319 | 319 |
database.SetCleanUpItem(item.ID,0); |
320 | 320 |
} |
321 | 321 |
} |
322 |
|
|
322 | 323 |
} |
323 |
catch (Exception ex)
|
|
324 |
{
|
|
325 |
System.Diagnostics.Debug.WriteLine(ex.ToString());
|
|
326 |
}
|
|
324 |
}
|
|
325 |
catch (Exception ex)
|
|
326 |
{
|
|
327 |
throw new Exception("CleanUpDataBaseItems Error ", ex);
|
|
327 | 328 |
} |
328 | 329 |
} |
329 | 330 |
|
ConvertService/ServiceBase/ServiceBase.sln | ||
---|---|---|
81 | 81 |
EndProject |
82 | 82 |
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PemssDocumentInfoTest", "PemssDocumentInfoTest\PemssDocumentInfoTest.csproj", "{535AA98D-063A-46A4-86D8-371F6C16C099}" |
83 | 83 |
EndProject |
84 |
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "StationRestTest", "StationRestTest\", "{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}" |
|
85 |
ProjectSection(WebsiteProperties) = preProject |
|
86 |
TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.5" |
|
87 |
Debug.AspNetCompiler.VirtualPath = "/localhost_64413" |
|
88 |
Debug.AspNetCompiler.PhysicalPath = "StationRestTest\" |
|
89 |
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_64413\" |
|
90 |
Debug.AspNetCompiler.Updateable = "true" |
|
91 |
Debug.AspNetCompiler.ForceOverwrite = "true" |
|
92 |
Debug.AspNetCompiler.FixedNames = "false" |
|
93 |
Debug.AspNetCompiler.Debug = "True" |
|
94 |
Release.AspNetCompiler.VirtualPath = "/localhost_64413" |
|
95 |
Release.AspNetCompiler.PhysicalPath = "StationRestTest\" |
|
96 |
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_64413\" |
|
97 |
Release.AspNetCompiler.Updateable = "true" |
|
98 |
Release.AspNetCompiler.ForceOverwrite = "true" |
|
99 |
Release.AspNetCompiler.FixedNames = "false" |
|
100 |
Release.AspNetCompiler.Debug = "False" |
|
101 |
VWDPort = "64413" |
|
102 |
SlnRelativePath = "StationRestTest\" |
|
103 |
DefaultWebSiteLanguage = "Visual C#" |
|
104 |
EndProjectSection |
|
105 |
EndProject |
|
84 | 106 |
Global |
85 | 107 |
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
86 | 108 |
Debug|Any CPU = Debug|Any CPU |
... | ... | |
319 | 341 |
{535AA98D-063A-46A4-86D8-371F6C16C099}.Release|x64.Build.0 = Release|Any CPU |
320 | 342 |
{535AA98D-063A-46A4-86D8-371F6C16C099}.Release|x86.ActiveCfg = Release|Any CPU |
321 | 343 |
{535AA98D-063A-46A4-86D8-371F6C16C099}.Release|x86.Build.0 = Release|Any CPU |
344 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|
345 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|
346 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Debug|x64.ActiveCfg = Debug|Any CPU |
|
347 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Debug|x64.Build.0 = Debug|Any CPU |
|
348 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Debug|x86.ActiveCfg = Debug|Any CPU |
|
349 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Debug|x86.Build.0 = Debug|Any CPU |
|
350 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Release|Any CPU.ActiveCfg = Debug|Any CPU |
|
351 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Release|Any CPU.Build.0 = Debug|Any CPU |
|
352 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Release|x64.ActiveCfg = Debug|Any CPU |
|
353 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Release|x64.Build.0 = Debug|Any CPU |
|
354 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Release|x86.ActiveCfg = Debug|Any CPU |
|
355 |
{F7C76CE2-EB5A-4E7D-BD9C-4596BD2A62D5}.Release|x86.Build.0 = Debug|Any CPU |
|
322 | 356 |
EndGlobalSection |
323 | 357 |
GlobalSection(SolutionProperties) = preSolution |
324 | 358 |
HideSolutionNode = FALSE |
ConvertService/ServiceBase/ServiceTestApp/App.config | ||
---|---|---|
52 | 52 |
name="ConversionSoap" /> |
53 | 53 |
</client> |
54 | 54 |
</system.serviceModel> |
55 |
<system.net> |
|
56 |
<defaultProxy enabled = "true"> |
|
57 |
<proxy bypassonlocal="false" proxyaddress="http://127.0.0.1:8888" /> |
|
58 |
</defaultProxy> |
|
59 |
</system.net> |
|
55 | 60 |
</configuration> |
ConvertService/ServiceBase/ServiceTestApp/MainWindow.xaml.cs | ||
---|---|---|
11 | 11 |
using System.Diagnostics; |
12 | 12 |
using System.IO; |
13 | 13 |
using System.Linq; |
14 |
using System.Net; |
|
14 | 15 |
using System.Net.Http; |
15 | 16 |
using System.ServiceModel; |
16 | 17 |
using System.Text; |
... | ... | |
460 | 461 |
|
461 | 462 |
//Console.WriteLine(responseText); |
462 | 463 |
|
463 |
|
|
464 |
//using (var client = new System.Net.Http.HttpClient()) |
|
465 |
//{ |
|
466 |
// var uri2 = new Uri("http://localhost:9101/StationService/Rest/GetConvertItem"); |
|
467 |
|
|
468 |
// var data2 = new SEND |
|
469 |
// { |
|
470 |
// ProjectNo = "111111", |
|
471 |
// DocumentID = "453" |
|
472 |
// }; |
|
473 |
|
|
474 |
// var jsonRequest2 = JsonConvert.SerializeObject(data2); |
|
475 |
// var stringContent = new System.Net.Http.StringContent(jsonRequest2, Encoding.UTF8, "application/json"); |
|
476 |
// var response = await client.PostAsync(uri2, stringContent); |
|
477 |
|
|
478 |
// if (response.IsSuccessStatusCode) |
|
479 |
// { |
|
480 |
// System.Diagnostics.Debug.WriteLine(response.Content.Headers.First()); |
|
481 |
// System.Diagnostics.Debug.WriteLine(await response.Content.ReadAsStringAsync()); |
|
482 |
// } |
|
483 |
//} |
|
484 |
|
|
485 | 464 |
using (var client = new System.Net.Http.HttpClient()) |
486 | 465 |
{ |
487 |
var uri2 = new Uri("http://localhost:13009/MarkusService.svc/Rest/GetCommantList"); |
|
488 | 466 |
|
467 |
var uri2 = new Uri("http://localhost:9101/StationService/Rest/GetConvertItem"); |
|
489 | 468 |
var data2 = new SEND |
490 | 469 |
{ |
491 | 470 |
ProjectNo = "111111", |
... | ... | |
503 | 482 |
} |
504 | 483 |
} |
505 | 484 |
|
485 |
//using (var client = new System.Net.Http.HttpClient()) |
|
486 |
//{ |
|
487 |
// var uri2 = new Uri("http://localhost:13009/MarkusService.svc/Rest/GetCommantList"); |
|
488 |
|
|
489 |
// var data2 = new SEND |
|
490 |
// { |
|
491 |
// ProjectNo = "111111", |
|
492 |
// DocumentID = "453" |
|
493 |
// }; |
|
494 |
|
|
495 |
// var jsonRequest2 = JsonConvert.SerializeObject(data2); |
|
496 |
// var stringContent = new System.Net.Http.StringContent(jsonRequest2, Encoding.UTF8, "application/json"); |
|
497 |
// var response = await client.PostAsync(uri2, stringContent); |
|
498 |
|
|
499 |
// if (response.IsSuccessStatusCode) |
|
500 |
// { |
|
501 |
// System.Diagnostics.Debug.WriteLine(response.Content.Headers.First()); |
|
502 |
// System.Diagnostics.Debug.WriteLine(await response.Content.ReadAsStringAsync()); |
|
503 |
// } |
|
504 |
//} |
|
505 |
|
|
506 | 506 |
//var client2 = new System.Net.WebClient(); |
507 | 507 |
//client2.Proxy = new System.Net.WebProxy("127.0.0.1", 8888); |
508 | 508 |
//var result = await client2.DownloadStringTaskAsync("http://localhost:9101/StationService/Rest/GetConvertItem?ProjectNo=111111&DocumentID=453"); |
내보내기 Unified diff