Ticket #4306: 0001-Flush-the-index-before-send-created-signal-SL-4306.patch

File 0001-Flush-the-index-before-send-created-signal-SL-4306.patch, 1.0 KB (added by godiard, 11 years ago)

Another alternative solution

  • src/carquinyol/datastore.py

    From 376ff08dfb22ef837c0b77f89774168edc1f9f4c Mon Sep 17 00:00:00 2001
    From: Gonzalo Odiard <godiard@gmail.com>
    Date: Fri, 14 Dec 2012 15:34:41 -0300
    Subject: [PATCH] Flush the index before send created signal - SL #4306
    
    After check the sequence of events, I found than at times,
    the Created dbus signal before the index was flushed.
    This patch check if the index is updated, and if not, flush it
    inmediatly before the signal is emited.
    
    Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
    ---
     src/carquinyol/datastore.py | 2 ++
     1 file changed, 2 insertions(+)
    
    diff --git a/src/carquinyol/datastore.py b/src/carquinyol/datastore.py
    index 212901b..93f335b 100644
    a b class DataStore(dbus.service.Object): 
    261261        if exc is not None:
    262262            async_err_cb(exc)
    263263            return
     264        if not self._index_store.get_index_updated():
     265            self._index_store.flush()
    264266
    265267        self.Created(uid)
    266268        self._optimizer.optimize(uid)