markus / ConvertService / ServiceBase / Markus.Service.ConvertProcess / Program.cs @ 974af55b
이력 | 보기 | 이력해설 | 다운로드 (3.03 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 |
convetContext = ObjectToBytesStringConvert.BytesStringToObject<ProcessContext>(AESEncrypter.Decrypt(args[1])); |
38 |
|
39 |
convert = new Service.Convert.ConvertService(convetContext); |
40 |
|
41 |
var convertFile = convert.SetFileAsync(); |
42 |
convertFile.Wait(); |
43 |
|
44 |
if(convertFile.Result.StatusCode != StatusCodeType.Completed) |
45 |
{ |
46 |
logger.Error($"Markus.Service.ConvertProcess Error ConvertId : {convetContext.ConvertID}"); |
47 |
} |
48 |
else |
49 |
{ |
50 |
|
51 |
} |
52 |
} |
53 |
} |
54 |
catch (Exception ex) |
55 |
{ |
56 |
logger.Error($"Markus.Service.ConvertProcess Error ConvertId : {convetContext.ConvertID}", ex); |
57 |
} |
58 |
finally |
59 |
{ |
60 |
convert?.Dispose(); |
61 |
GC.Collect(); |
62 |
GC.WaitForPendingFinalizers(); |
63 |
GC.Collect(); |
64 |
|
65 |
Application.Exit(); |
66 |
} |
67 |
} |
68 |
} |
69 |
} |