[longomatch] Fix database backup when the backup dir exists



commit d1c85267306fac3984e3cf6985c5a4585c3f36a3
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Feb 13 13:57:01 2015 +0100

    Fix database backup when the backup dir exists

 LongoMatch.Services/Services/FileDB.cs |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.Services/Services/FileDB.cs b/LongoMatch.Services/Services/FileDB.cs
index 7b96f82..8d3ba3d 100644
--- a/LongoMatch.Services/Services/FileDB.cs
+++ b/LongoMatch.Services/Services/FileDB.cs
@@ -109,7 +109,7 @@ namespace LongoMatch.DB
                        backupDir = new DirectoryInfo (dbDirPath + ".backup");
                        try {
                                if (backupDir.Exists) {
-                                       backupDir.Delete ();
+                                       backupDir.Delete (true);
                                }
                                backupDir.Create ();
                                files = dbDir.GetFiles ();
@@ -120,7 +120,8 @@ namespace LongoMatch.DB
                                projectsDB.LastBackup = DateTime.UtcNow;
                                projectsDB.Save ();
                                return true;
-                       } catch {
+                       } catch (Exception ex) {
+                               Log.Exception (ex);
                                return false;
                        }
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]