[evolution-data-server/gnome-3-38] I#257 - Ineffective refresh of book/calendar meta backends
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-38] I#257 - Ineffective refresh of book/calendar meta backends
- Date: Mon, 19 Oct 2020 10:45:24 +0000 (UTC)
commit 78f5523b7f4f360c2c8e2a8150d69f3e9c6e4bb3
Author: Milan Crha <mcrha redhat com>
Date: Mon Oct 19 12:42:11 2020 +0200
I#257 - Ineffective refresh of book/calendar meta backends
Closes https://gitlab.gnome.org/GNOME/evolution-data-server/-/issues/257
src/addressbook/libedata-book/e-book-meta-backend.c | 5 +++++
src/calendar/libedata-cal/e-cal-meta-backend.c | 5 +++++
src/libebackend/e-cache.c | 2 +-
3 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/src/addressbook/libedata-book/e-book-meta-backend.c
b/src/addressbook/libedata-book/e-book-meta-backend.c
index 3cce96420..b4dd9eb98 100644
--- a/src/addressbook/libedata-book/e-book-meta-backend.c
+++ b/src/addressbook/libedata-book/e-book-meta-backend.c
@@ -824,6 +824,8 @@ ebmb_refresh_internal_sync (EBookMetaBackend *meta_backend,
}
}
+ e_cache_lock (E_CACHE (book_cache), E_CACHE_LOCK_WRITE);
+
while (repeat && success &&
!g_cancellable_set_error_if_cancelled (cancellable, error)) {
GSList *created_objects = NULL, *modified_objects = NULL, *removed_objects = NULL;
@@ -867,6 +869,9 @@ ebmb_refresh_internal_sync (EBookMetaBackend *meta_backend,
is_repeat = TRUE;
}
+ /* Always commit, to store at least what could be processed */
+ e_cache_unlock (E_CACHE (book_cache), E_CACHE_UNLOCK_COMMIT);
+
g_object_unref (book_cache);
done:
diff --git a/src/calendar/libedata-cal/e-cal-meta-backend.c b/src/calendar/libedata-cal/e-cal-meta-backend.c
index c4415d5bd..3ccbb0d30 100644
--- a/src/calendar/libedata-cal/e-cal-meta-backend.c
+++ b/src/calendar/libedata-cal/e-cal-meta-backend.c
@@ -724,6 +724,8 @@ ecmb_refresh_internal_sync (ECalMetaBackend *meta_backend,
}
}
+ e_cache_lock (E_CACHE (cal_cache), E_CACHE_LOCK_WRITE);
+
while (repeat && success &&
!g_cancellable_set_error_if_cancelled (cancellable, error)) {
GSList *created_objects = NULL, *modified_objects = NULL, *removed_objects = NULL;
@@ -767,6 +769,9 @@ ecmb_refresh_internal_sync (ECalMetaBackend *meta_backend,
is_repeat = TRUE;
}
+ /* Always commit, to store at least what could be processed */
+ e_cache_unlock (E_CACHE (cal_cache), E_CACHE_UNLOCK_COMMIT);
+
g_object_unref (cal_cache);
done:
diff --git a/src/libebackend/e-cache.c b/src/libebackend/e-cache.c
index 48a679358..72ff066f3 100644
--- a/src/libebackend/e-cache.c
+++ b/src/libebackend/e-cache.c
@@ -2655,7 +2655,7 @@ e_cache_lock (ECache *cache,
break;
}
} else {
- /* Warn about cases where where a read transaction might be upgraded */
+ /* Warn about cases where a read transaction might be upgraded */
if (lock_type == E_CACHE_LOCK_WRITE && cache->priv->lock_type == E_CACHE_LOCK_READ)
g_warning (
"A nested transaction wants to write, "
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]