[geary/wip/714134-gc: 2/3] More final touches
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/714134-gc: 2/3] More final touches
- Date: Fri, 19 Dec 2014 00:21:11 +0000 (UTC)
commit a952dc514fc38a4841e96de1972e651cc8c14ade
Author: Jim Nelson <jim yorba org>
Date: Thu Dec 18 16:20:02 2014 -0800
More final touches
sql/version-024.sql | 3 ++-
src/engine/imap-db/imap-db-gc.vala | 12 ++++++------
2 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/sql/version-024.sql b/sql/version-024.sql
index f29a1fe..4cc89bb 100644
--- a/sql/version-024.sql
+++ b/sql/version-024.sql
@@ -19,6 +19,7 @@ CREATE TABLE GarbageCollectionTable (
reaped_messages_since_last_vacuum INTEGER DEFAULT 0
);
--- Insert a single row with a well-known rowid with default values
+-- Insert a single row with a well-known rowid and default values, this will be the row used
+-- by the ImapDB.GC class.
INSERT INTO GarbageCollectionTable (id) VALUES (0);
diff --git a/src/engine/imap-db/imap-db-gc.vala b/src/engine/imap-db/imap-db-gc.vala
index 425b13a..0dae3ae 100644
--- a/src/engine/imap-db/imap-db-gc.vala
+++ b/src/engine/imap-db/imap-db-gc.vala
@@ -199,7 +199,9 @@ private class Geary.ImapDB.GC {
if (last_vacuum_time == null)
last_vacuum_time = new DateTime.now_local();
- // update last vacuum time and reset messages reaped since last vacuum
+ // update last vacuum time and reset messages reaped since last vacuum ... don't allow this
+ // to be cancelled, really want to get this in stone so the user doesn't re-vacuum
+ // unnecessarily
yield db.exec_transaction_async(Db.TransactionType.WO, (cx) => {
Db.Statement stmt = cx.prepare("""
UPDATE GarbageCollectionTable
@@ -212,7 +214,7 @@ private class Geary.ImapDB.GC {
stmt.exec(cancellable);
return Db.TransactionOutcome.COMMIT;
- }, cancellable);
+ }, null);
}
/**
@@ -390,7 +392,7 @@ private class Geary.ImapDB.GC {
// If find one, then message is no longer unlinked
Db.Result result = stmt.exec(cancellable);
if (!result.finished) {
- debug("[%s] Not garbage collection message #%s: found linked in location table",
+ debug("[%s] Not reaping message #%s: found linked in MessageLocationTable",
to_string(), message_id.to_string());
return Db.TransactionOutcome.ROLLBACK;
@@ -513,9 +515,7 @@ private class Geary.ImapDB.GC {
bool first = true;
while (!result.finished) {
int64 id = result.rowid_at(0);
- string filename = result.string_at(1);
-
- File file = File.new_for_path(filename);
+ File file = File.new_for_path(result.string_at(1));
// if it deletes, great; if not, we tried
try {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]