[longomatch] Fix database backup when the backup dir exists
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Fix database backup when the backup dir exists
- Date: Fri, 13 Feb 2015 13:21:53 +0000 (UTC)
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]