From 6853b96efe80e652e530a070ed18f16c9cd1c677 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1s=C3=A1ry=20D=C3=A1niel?= Date: Wed, 18 Oct 2017 11:37:28 +0000 Subject: [PATCH] git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C30643 --- .../Configuration/configuration-editor.json | 30 +++++-------------- client/Maestro/Maestro.csproj | 7 +++-- client/Maestro/Targets/FTPTargetProcessor.cs | 24 ++++++++++----- client/Maestro/Targets/FXPTargetProcessor.cs | 2 +- client/Maestro/Targets/UNCTargetProcessor.cs | 5 ++-- client/Maestro/packages.config | 2 +- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/client/Maestro/Configuration/configuration-editor.json b/client/Maestro/Configuration/configuration-editor.json index 466af5f5..baf13935 100644 --- a/client/Maestro/Configuration/configuration-editor.json +++ b/client/Maestro/Configuration/configuration-editor.json @@ -41,20 +41,6 @@ } ], "targets": [ - { - "label": "Nyersanyag betöltés", - "processor": "UNCTargetProcessor", - "outputFormat": "%ID%-%SOURCENAME%", - "tag": "Betöltés", - "createSubFolder": true, - "killDateDays": 7, - "remote": { - "address": "file://10.10.1.100/BRAAVOS/OCTOPUS", - "userName": "mediacube", - "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", - "timeout": 1000 - } - }, { "label": "Stúdióba küldés", "processor": "FTPTargetProcessor", @@ -71,14 +57,14 @@ }, { "label": "Hír nyersanyag betöltés", - "processor": "UNCTargetProcessor", + "processor": "FTPTargetProcessor", "outputFormat": "%ID%-%SOURCENAME%", "tag": "Betöltés", "createSubFolder": true, "killDateDays": 7, "useMetadata": false, "remote": { - "address": "file://10.10.1.100/BRAAVOS/OCTOPUS", + "address": "ftp://10.10.1.100/OCTOPUS", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 @@ -86,14 +72,14 @@ }, { "label": "Magazin nyersanyag betöltés", - "processor": "UNCTargetProcessor", + "processor": "FTPTargetProcessor", "outputFormat": "%ID%-%SOURCENAME%", "tag": "Betöltés", "createSubFolder": true, "killDateDays": 7, "useMetadata": false, "remote": { - "address": "file://10.10.1.100/BRAAVOS/PLAYOUT_NLE", + "address": "ftp://10.10.1.100/PLAYOUT_NLE", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 @@ -101,12 +87,12 @@ }, { "label": "Lebonyba küldés", - "processor": "UNCTargetProcessor", + "processor": "FTPTargetProcessor", "outputFormat": "%ID%", "tag": "Betöltés", "killDateDays": 7, "remote": { - "address": "file://10.10.1.100/BRAAVOS/PLAYOUT_CHECK", + "address": "ftp://10.10.1.100/PLAYOUT_CHECK", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 @@ -114,12 +100,12 @@ }, { "label": "Archiválás", - "processor": "UNCTargetProcessor", + "processor": "FTPTargetProcessor", "outputFormat": "%ID%", "tag": "Archiválás", "useMetadata": true, "remote": { - "address": "file://10.10.1.100/BRAAVOS/ARCHIVE", + "address": "ftp://10.10.1.100/ARCHIVE", "userName": "mediacube", "password": "Dn8t4gfHcK98o8hyPgLDhr5SgSji4JCxsfpMJsODikUp3nXgrM0UNCi45lLAK8ZOnmEneO44P9qpJ4QDqhctN6MxZodjJgdZTyoZKmSa+ECzEzLr/wPYNgxVaXrVotEy", "timeout": 1000 diff --git a/client/Maestro/Maestro.csproj b/client/Maestro/Maestro.csproj index 6fa4b0a3..bd8ea185 100644 --- a/client/Maestro/Maestro.csproj +++ b/client/Maestro/Maestro.csproj @@ -102,8 +102,8 @@ Properties\app.manifest - - ..\packages\FluentFTP.17.5.8\lib\net45\FluentFTP.dll + + ..\packages\FluentFTP.19.1.1\lib\net45\FluentFTP.dll ..\packages\LinkDotNet.MessageBus.0.1.1\lib\LinkDotNet.MessageHandling.dll @@ -157,6 +157,9 @@ + + + diff --git a/client/Maestro/Targets/FTPTargetProcessor.cs b/client/Maestro/Targets/FTPTargetProcessor.cs index 52358d25..52043d14 100644 --- a/client/Maestro/Targets/FTPTargetProcessor.cs +++ b/client/Maestro/Targets/FTPTargetProcessor.cs @@ -42,29 +42,39 @@ namespace Maestro.Targets { } catch (Exception e) { logger.Error(e.Message); + throw e; } finally { ostream.Close(); } } } - if (parameters.TargetConfig.NexioServer) - Thread.Sleep(500); + FtpReply reply = targetFTP.GetReply(); + if (reply.Success && "226".Equals(reply.Code)) { + if (!FileExists(Output)) + throw new Exception("Feltöltési hiba."); + } + } + + protected void reconnect() { + TerminateClient(targetFTP); + targetFTP = CreateClient(parameters.TargetConfig.Remote); + EnsureDirectoryExistence(workingDir); } protected override void UploadContent(string outputPath, byte[] content) { - using (Stream ostream = targetFTP.OpenWrite(outputPath)) { + using (Stream ostream = targetFTP.OpenWrite(outputPath, FtpDataType.Binary, false)) { try { ostream.Write(content, 0, content.Length); } catch (Exception e) { logger.Error(e.Message); - } finally{ + throw e; + } + finally { ostream.Close(); - } + } } - if (parameters.TargetConfig.NexioServer) - Thread.Sleep(500); } protected override bool FileExists(string path) { diff --git a/client/Maestro/Targets/FXPTargetProcessor.cs b/client/Maestro/Targets/FXPTargetProcessor.cs index bf7fd742..bb4d5279 100644 --- a/client/Maestro/Targets/FXPTargetProcessor.cs +++ b/client/Maestro/Targets/FXPTargetProcessor.cs @@ -84,7 +84,7 @@ namespace Maestro.Targets { Progress = currentProgress > 100 ? 100 : currentProgress; lastSize = overall; } - Thread.Sleep(2000); + Thread.Sleep(1000); } } diff --git a/client/Maestro/Targets/UNCTargetProcessor.cs b/client/Maestro/Targets/UNCTargetProcessor.cs index be7d9b61..65f9d049 100644 --- a/client/Maestro/Targets/UNCTargetProcessor.cs +++ b/client/Maestro/Targets/UNCTargetProcessor.cs @@ -89,8 +89,6 @@ namespace Maestro.Targets { protected override void ExecuteCompleted() { base.ExecuteCompleted(); - Status = "Kész"; - Message = SUCCESS; workFlowAction.description = SUCCESS; workFlowAction.successful = true; if (parameters.TargetConfig.NexioServer) @@ -109,6 +107,8 @@ namespace Maestro.Targets { } if (parameters.TargetConfig.SendEmailOnSuccess && !String.IsNullOrEmpty(parameters.TargetConfig.SuccessEmailRecipient) && !String.IsNullOrEmpty(parameters.TargetConfig.SuccessEmailPattern)) SendEmail(parameters.TargetConfig.SuccessEmailRecipient, parameters.TargetConfig.SuccessEmailPattern); + Status = "Kész"; + Message = SUCCESS; } private void UploadNexioMetadata() { @@ -204,6 +204,7 @@ namespace Maestro.Targets { int read, overall = 0; while ((read = istream.Read(buffer, 0, buffer.Length)) > 0) { ostream.Write(buffer, 0, read); + ostream.Flush(); overall += read; Progress = (int)((double)overall / ilength * 100); } diff --git a/client/Maestro/packages.config b/client/Maestro/packages.config index 38048ef9..3c8078b6 100644 --- a/client/Maestro/packages.config +++ b/client/Maestro/packages.config @@ -1,6 +1,6 @@  - + -- 2.54.0