[geary/wip/714134-gc] Final touches
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/714134-gc] Final touches
- Date: Fri, 19 Dec 2014 00:00:26 +0000 (UTC)
commit 6da68d5584e3b6007b3606a285ec074e55960ec3
Author: Jim Nelson <jim yorba org>
Date: Thu Dec 18 16:00:25 2014 -0800
Final touches
src/engine/imap-db/imap-db-folder.vala | 9 +++++++++
src/engine/imap-db/imap-db-gc.vala | 10 +++++-----
2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/src/engine/imap-db/imap-db-folder.vala b/src/engine/imap-db/imap-db-folder.vala
index b9a4bae..91d50a8 100644
--- a/src/engine/imap-db/imap-db-folder.vala
+++ b/src/engine/imap-db/imap-db-folder.vala
@@ -1983,6 +1983,15 @@ private class Geary.ImapDB.Folder : BaseObject, Geary.ReferenceSemantics {
File saved_file = ImapDB.Attachment.generate_file(db.db_file.get_parent(), message_id,
attachment_id, filename);
+ // On the off-chance this is marked for deletion, unmark it
+ stmt = cx.prepare("""
+ DELETE FROM DeleteAttachmentFileTable
+ WHERE filename = ?
+ """);
+ stmt.bind_string(0, saved_file.get_path());
+
+ stmt.exec(cancellable);
+
debug("Saving attachment to %s", saved_file.get_path());
try {
diff --git a/src/engine/imap-db/imap-db-gc.vala b/src/engine/imap-db/imap-db-gc.vala
index 39a5525..425b13a 100644
--- a/src/engine/imap-db/imap-db-gc.vala
+++ b/src/engine/imap-db/imap-db-gc.vala
@@ -25,7 +25,7 @@
*/
private class Geary.ImapDB.GC {
- // Minimum number of days between reaping runs.
+ // Maximum number of days between reaping runs.
private const int REAP_DAYS_SPAN = 10;
// Minimum number of days between vacuums.
@@ -105,7 +105,7 @@ private class Geary.ImapDB.GC {
int64 days;
if (last_reap_time == null) {
// null means reaping has never executed
- debug("[%s] Recommending reaping: never run", to_string());
+ debug("[%s] Recommending reaping: never completed", to_string());
op |= RecommendedOperation.REAP;
} else if (elapsed_days(now, last_reap_time, out days) >= REAP_DAYS_SPAN) {
@@ -114,7 +114,7 @@ private class Geary.ImapDB.GC {
op |= RecommendedOperation.REAP;
} else {
- debug("[%s] Reaping last run on %s (%s days ago)", to_string(),
+ debug("[%s] Reaping last completed on %s (%s days ago)", to_string(),
last_reap_time.to_string(), days.to_string());
}
@@ -129,12 +129,12 @@ private class Geary.ImapDB.GC {
vacuum_permitted = true;
} else if (elapsed_days(now, last_vacuum_time, out days) >= VACUUM_DAYS_SPAN) {
- debug("[%s] Database vacuuming permitted (%s days since last run, %d messages reaped since",
+ debug("[%s] Database vacuuming permitted (%s days since last run, %d messages reaped since)",
to_string(), days.to_string(), reaped_messages_since_last_vacuum);
vacuum_permitted = true;
} else {
- debug("[%s] Database vacuuming not permitted (%s days since last run, %d messages reaped since",
+ debug("[%s] Database vacuuming not permitted (%s days since last run, %d messages reaped since)",
to_string(), days.to_string(), reaped_messages_since_last_vacuum);
vacuum_permitted = false;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]