D20040: Don't finish collection sync task too early

Daniel Vrátil noreply at phabricator.kde.org
Mon Mar 25 16:25:54 GMT 2019


dvratil added inline comments.

INLINE COMMENTS

> resourcebase.cpp:136
> +
> +        if (scheduler->currentTask().type == ResourceScheduler::ChangeReplay)
> +            scheduler->taskDone();

I would actually change this into an `assert()`, move it to the beginning of the function and try to find out what resource implementation calls `changeProcessed()` when not handling a ChangeReplay task.

The rules are that after successfully finishing a task resource implementation should

for retrieval task, call `ResourceBase::*retrievalDone()`/`ResourceBase::*retrieved()`
for add/modify change replay task, call `ResourceBase::changeCommitted()`
for remove change replay task, call `ResourceBase::changeProcessed()`
for a custom task, call `ResourceBase::taskDone()`

In the first 3 cases, the methods will call `ResourceBase::taskDone()` internally themselves, possibly asynchronously. In any case, you must call `taskDone()` every time in order to trigger processing of a next task in the ResourceScheduler queue.

REPOSITORY
  R165 Akonadi

REVISION DETAIL
  https://phabricator.kde.org/D20040

To: mwolff, dvratil, dfaure
Cc: kde-pim, dvasin, rodsevich, winterz, vkrause, mlaurent, knauss, dvratil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20190325/0fcb2dd1/attachment.html>


More information about the kde-pim mailing list