markus / ConvertService / ServiceBase / Markus.Service.ConvertProcess / Program.cs @ a9e86f7a
이력 | 보기 | 이력해설 | 다운로드 (3.14 KB)
1 |
using log4net; |
---|---|
2 |
using Markus.Message; |
3 |
using Markus.Service.Extensions; |
4 |
using Markus.Service.Helper; |
5 |
using System; |
6 |
using System.Collections.Generic; |
7 |
using System.Linq; |
8 |
using System.ServiceModel; |
9 |
using System.Text; |
10 |
using System.Threading.Tasks; |
11 |
using System.Web.Script.Serialization; |
12 |
using System.Windows.Forms; |
13 |
using static Markus.Service.Extensions.Encrypt; |
14 |
|
15 |
namespace Markus.Service.ConvertProcess |
16 |
{ |
17 |
class Convert |
18 |
{ |
19 |
protected static ILog logger; |
20 |
protected static Service.Convert.ConvertService convert; |
21 |
|
22 |
private static ProcessContext convetContext; |
23 |
|
24 |
[MTAThread] |
25 |
static void Main(string[] args) |
26 |
{ |
27 |
try |
28 |
{ |
29 |
logger = LogManager.GetLogger(typeof(Convert)); |
30 |
//#if DEBUG |
31 |
// args = new[] { "11cb3ebc-2323-3b12-1a3e-87a783579ec3", "9gW0LjBVZwt3Z5opwby84cqlTB9oEZzLWBpFJ6LmRo0DArLL680d3EWmRT2gQ5E6gqNSmuC7Jse/4JZPXR9srb1NGnt3B4682sQAX6bfd412bdc+3pqI+ZySkvfAuiaESFWWYlEpDTUahE2mGpenD+JIA3lLBR5DNtdTlpYMHiI8/TiciIizUNbFKy7Ubp4dJ1QvBsNA+r5TcKvuSZIykLTaxAvIfC9T31wYSG9d24vkm3cj2NdzWIKNoYGj9wCREoaakyKANyTumVSlfTFclizlZACANPopOOmpb+FG4f7kGEn0tMCAKPo8Vx1muRLDXM/pVfOUAsisXWHfc/A7Vxfx/xQuVQX55SZWxOGPtdNXFiyfXnBIE0MANMnYthnxzbp2ZqYEXvJlClMrcRCLpUQ/SDVOvvhaTmU4FfyKaKVMTZ6yMlbqqSvYZr9R7NN+UW+h2ghsfJhx3y+GNIRpqHVriP/C6mc3hV72mDAAe+00uV4DlvO78qMCaX0xIXj0VjQHiEA2ePcpZRxFcVf6luE1n37OVFecv89cxl3Tk+fD7MjIJYvuy3U8WySDm1XqDlO1PX/yz/xDhtjHIXnkxK+upqoVr+W5Sd9uRN+JGsGP3AkGbWg01sQOe1T63om3gPIjMtCPrkhjSdQRED/mpJumeR85j/2uBIkkBbXWVJQs8tG+Engcd6+zCyoNJ8tf2+GBozzjXIPHCze57i9kWrtp4scfop8aAlaUsexC3C3msu3ZP9+LaLrqtcGTvO9XXhSld/B2pB3fF1r/PPESJCKavStakkwH80ak2FvY/p9bsf/jB9TDTXHuinTq52fNlT0SUFwMZvDcit7qODlRtLuwfODyZbPqx6bu2Eh4o/2+AQ4a9lvSfUGXJY88Q+JycNXEvJv0A5WQBdtjkdBFt6I0Lc8y8Vme8x7RDE76UwfOrsaEOdBh1oo9dg60eWp7t3QSRSOh5gDV3jfwqPVRkdSLUPujX6VRKCNkYclUtQcfd/vPQFEIyXaeRYHcJa5AVCNLFcoAg4Lp8BxXuNvxtg==" }; |
32 |
//#endif |
33 |
if (args.Length == 2) |
34 |
{ |
35 |
string ConvertID = args[0]; |
36 |
|
37 |
logger.Info($"Markus.Service.ConvertProcess ConvertID :{args[0]} param : {args[1]}"); |
38 |
|
39 |
convetContext = ObjectToBytesStringConvert.BytesStringToObject<ProcessContext>(AESEncrypter.Decrypt(args[1])); |
40 |
|
41 |
convert = new Service.Convert.ConvertService(convetContext); |
42 |
|
43 |
var convertFile = convert.SetFileAsync(); |
44 |
convertFile.Wait(); |
45 |
|
46 |
if(convertFile.Result.StatusCode != StatusCodeType.Completed) |
47 |
{ |
48 |
logger.Error($"Markus.Service.ConvertProcess Error ConvertId : {convetContext.ConvertID}"); |
49 |
} |
50 |
else |
51 |
{ |
52 |
|
53 |
} |
54 |
} |
55 |
} |
56 |
catch (Exception ex) |
57 |
{ |
58 |
logger.Error($"Markus.Service.ConvertProcess Error ConvertId : {convetContext.ConvertID}", ex); |
59 |
} |
60 |
finally |
61 |
{ |
62 |
convert?.Dispose(); |
63 |
GC.Collect(); |
64 |
GC.WaitForPendingFinalizers(); |
65 |
GC.Collect(); |
66 |
|
67 |
Application.Exit(); |
68 |
} |
69 |
} |
70 |
} |
71 |
} |