markus / ConvertService / ServiceBase / Markus.Service.ConvertProcess / Program.cs @ 950e6b84
이력 | 보기 | 이력해설 | 다운로드 (3.22 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", "wFMd/53AD9totL5hkl6/NF+TbGETdz+qAVetxtTABjxpsNuMYwnuvgCxaD7Yj+k9POikXsP/zCg3AUasWZI9JhR5umwx/zcylkulmw2zQr2dm7oI4M5+8TnkUyA6RvXrbgrN8gnpKZJdops80Kf9mHkVy8z36FxbL+lYnIokahZSNbi5RgZlOxHmoH73PnHtjRFQa/f6VsGGD3FzBTHDNpZdJT8zrW8WGQFfTM8QukmzRMg4I+nQD3Qu0AWJVxCkmyJpEbjJIuFEpe13YCv53A0NjXLiNWrBB1cRcZ+Y6Do21bs8kxWQZsSZ3e/3zP5UPrpPpurz7kNGr+kX29v9/ggl2JMnrUOQX1Z1KCKHnI/YB8CbzBkxB0ZimJB4GkXc7kSvovMatP1oAtcjFawPhJXvFma8hwJocByo4YQ2EjJ4tSnJcpPJjKk+0ivMRK9+MOUvVSm1Ysm+IrG7GFTB4UwtmzJX1VKYlFm2iAd2wk4g7/ekwzpvWyiG/QrYjHDFILpI2MIOpMic/P6fvV39EDnpLd5k4j/9Pf2kOdISs+s5i6eeAHdPSP2NulcBCoB3jLZe3VZtrHA944inEPBM70Z/kjhm/21HUoKyzjp+o67eXBFNlPmLFFJ7P+uJOJ8LzrrgIpmPomNS5e5NuRqNgESzhBv5NTY0GCnGeUSVY/lWUgouOR3d/AyHJirsKRAxfIQA1mux4ehr9zLzWSuXA8uJTbf57MYMx3B4ldecQneEovI0gdAgWB1c0HT6Agov44xRjczw18AtGDIDYEWiWjroAAF+AyXZu/4gy3oWGT7QkfsByOguNzNnfWav7x015FJjDRClXnX1iS8/791LJJwQiUDC0VeqfVbIMYUc/YRfzuX3vmOIN6LJ2WoO2aXfd7+bhfln+nmfQ1XADeDDIpV6yjAsvjYR1o4saCTPyTxbrSxbT+nPGnglbD/r0PfckECibCYSfnx1JBNI96+gE3i+oY++leYc5AlnxGX7a+mcrRF7GNe9/0iEU2c8ZO/8A7sAafV7CwSE+FbVkktz1wX+fu/NuruJxUvKKMu7bZtjWMWEK9GIO0EhRcIOHYfds63fiVTAfG2F7HSab2SOnwR17u+1e2Xk01thXYn4Dys=" }; |
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 |
} |