[hamster-applet] put remove_fact in transaction to avoid waiting for db flush
- From: Toms Baugis <tbaugis src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [hamster-applet] put remove_fact in transaction to avoid waiting for db flush
- Date: Thu, 21 Jan 2010 01:04:19 +0000 (UTC)
commit 58afbf4fba3ab16aab6d785d58384f36545039a6
Author: Toms Bauģis <toms baugis gmail com>
Date: Thu Jan 21 00:35:02 2010 +0000
put remove_fact in transaction to avoid waiting for db flush
hamster/storage.py | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/hamster/storage.py b/hamster/storage.py
index 4b94b20..a34b775 100644
--- a/hamster/storage.py
+++ b/hamster/storage.py
@@ -80,10 +80,12 @@ class Storage(object):
return self.__get_popular_categories()
def remove_fact(self, fact_id):
+ self.start_transaction()
fact = self.get_fact(fact_id)
if fact:
self.__remove_fact(fact_id)
self.dispatch('day_updated', fact['start_time'])
+ self.end_transaction()
def update_fact(self, fact_id, activity_name, tags, start_time, end_time, description = None):
now = datetime.datetime.now()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]