From 40117e7f5d249d8edd388938c400661bfe40ffb2 Mon Sep 17 00:00:00 2001 From: KircMax Date: Tue, 3 Jan 2023 13:11:09 +0100 Subject: [PATCH] Backup restore (#30) * remove unnecesary console writeline --- src/Webserver.API/Models/ApiClass.cs | 8 ++++++++ src/Webserver.API/Services/Backup/ApiBackupHandler.cs | 1 - .../Services/FileHandling/ApiFileResourceBuilder.cs | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Webserver.API/Models/ApiClass.cs b/src/Webserver.API/Models/ApiClass.cs index 625ff23..04917d4 100644 --- a/src/Webserver.API/Models/ApiClass.cs +++ b/src/Webserver.API/Models/ApiClass.cs @@ -37,5 +37,13 @@ public override bool Equals(object obj) /// public override int GetHashCode() => (Name).GetHashCode(); + /// + /// Return the Name + /// + /// Name + public override string ToString() + { + return Name; + } } } diff --git a/src/Webserver.API/Services/Backup/ApiBackupHandler.cs b/src/Webserver.API/Services/Backup/ApiBackupHandler.cs index d8558b7..a044150 100644 --- a/src/Webserver.API/Services/Backup/ApiBackupHandler.cs +++ b/src/Webserver.API/Services/Backup/ApiBackupHandler.cs @@ -95,7 +95,6 @@ public async Task RestoreBackupAsync(string restoreFilePath, string userName, st //var ticket = await ApiRequestHandler.ApiBrowseTicketsAsync(); var waitHandler = new WaitHandler(timeToWait); - Console.WriteLine($"{DateTime.Now}: Wait for plc to not be pingable anymore (reboot)."); WaitForPlcReboot(waitHandler); await ApiRequestHandler.ReLoginAsync(userName, password); ticketResponse = (await ApiRequestHandler.PlcRestoreBackupAsync(password)).Result; diff --git a/src/Webserver.API/Services/FileHandling/ApiFileResourceBuilder.cs b/src/Webserver.API/Services/FileHandling/ApiFileResourceBuilder.cs index 1afaa40..9d455d6 100644 --- a/src/Webserver.API/Services/FileHandling/ApiFileResourceBuilder.cs +++ b/src/Webserver.API/Services/FileHandling/ApiFileResourceBuilder.cs @@ -38,7 +38,6 @@ private void CheckResourcePath(string resourcePath) /// used to create an ApiFileResource from a given filename and localDirectoryPath /// /// Path to the File/Directory to build the resource from - /// Local Directory Path - used to determine the filename (Path!) /// the ApiFileResource public ApiFileResource BuildResourceFromFile(string resourcePath) {