evolution-data-server r8985 - branches/camel-db-summary/camel
- From: psankar svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution-data-server r8985 - branches/camel-db-summary/camel
- Date: Mon, 16 Jun 2008 09:18:36 +0000 (UTC)
Author: psankar
Date: Mon Jun 16 09:18:36 2008
New Revision: 8985
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8985&view=rev
Log:
Save messageinfo s first before saving the folderinfo.
Remove the ugly timer code.
Modified:
branches/camel-db-summary/camel/camel-folder-summary.c
Modified: branches/camel-db-summary/camel/camel-folder-summary.c
==============================================================================
--- branches/camel-db-summary/camel/camel-folder-summary.c (original)
+++ branches/camel-db-summary/camel/camel-folder-summary.c Mon Jun 16 09:18:36 2008
@@ -955,51 +955,35 @@
CamelDB *cdb = s->folder->parent_store->cdb;
CamelFIRecord *record;
int ret;
- GTimer *timer, *trans_timer;
-
-
- /* FIXME: Put these timers into a define or a env condition. */
- timer = g_timer_new ();
- trans_timer = g_timer_new ();
d(printf ("\ncamel_folder_summary_save_to_db called \n"));
camel_db_begin_transaction (cdb, ex);
- g_timer_start (trans_timer);
-
- record = (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_to_db (s, ex));
- if (!record) {
+
+ ret = save_message_infos_to_db (s, ex);
+
+ if (ret != 0) {
camel_db_abort_transaction (cdb, ex);
return -1;
}
- g_timer_start (timer);
- ret = camel_db_write_folder_info_record (cdb, record, ex);
- g_free (record);
- g_timer_stop (timer);
-
- d(g_print ("\n Folderinfo record time taken : [%f] \n", g_timer_elapsed (timer, NULL)));
- if (ret != 0) {
+ record = (((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->summary_header_to_db (s, ex));
+ if (!record) {
camel_db_abort_transaction (cdb, ex);
return -1;
}
- g_timer_start (timer);
- ret = save_message_infos_to_db (s, ex);
- g_timer_stop (timer);
+ ret = camel_db_write_folder_info_record (cdb, record, ex);
+ g_free (record);
if (ret != 0) {
camel_db_abort_transaction (cdb, ex);
return -1;
}
- d(g_print ("\n Messageinfo record time taken : [%f] \n", g_timer_elapsed (timer, NULL)));
camel_db_end_transaction (cdb, ex);
- g_timer_stop (trans_timer);
- d(g_print ("\n Transaction time taken : [%f] \n", g_timer_elapsed (trans_timer, NULL)));
-
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]