diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-19 20:20:10 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2015-07-19 20:25:29 +0200 |
commit | 20f6d6470bbb812d0aecd68c2fbb148daebd14d7 (patch) | |
tree | 5c881690abc0a90ca6026986744bc583194ddb82 | |
parent | a908ea3ecb5ad78e4bdadf13d40ff76d0a038b76 (diff) | |
download | sink-20f6d6470bbb812d0aecd68c2fbb148daebd14d7.tar.gz sink-20f6d6470bbb812d0aecd68c2fbb148daebd14d7.zip |
Skip commands we fail to process so we don't get stuck
-rw-r--r-- | common/genericresource.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp index a500aed..5dfa9b5 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp | |||
@@ -93,7 +93,7 @@ private slots: | |||
93 | queue->dequeue( | 93 | queue->dequeue( |
94 | [this, &future](void *ptr, int size, std::function<void(bool success)> messageQueueCallback) { | 94 | [this, &future](void *ptr, int size, std::function<void(bool success)> messageQueueCallback) { |
95 | auto callback = [messageQueueCallback, &future](bool success) { | 95 | auto callback = [messageQueueCallback, &future](bool success) { |
96 | messageQueueCallback(success); | 96 | messageQueueCallback(true); |
97 | future.setValue(!success); | 97 | future.setValue(!success); |
98 | future.setFinished(); | 98 | future.setFinished(); |
99 | }; | 99 | }; |
@@ -105,9 +105,11 @@ private slots: | |||
105 | return; | 105 | return; |
106 | } | 106 | } |
107 | auto queuedCommand = Akonadi2::GetQueuedCommand(ptr); | 107 | auto queuedCommand = Akonadi2::GetQueuedCommand(ptr); |
108 | Trace() << "Dequeued Command: " << Akonadi2::Commands::name(queuedCommand->commandId()); | 108 | const auto commandId = queuedCommand->commandId(); |
109 | Trace() << "Dequeued Command: " << Akonadi2::Commands::name(commandId); | ||
109 | processQueuedCommand(queuedCommand).then<void>( | 110 | processQueuedCommand(queuedCommand).then<void>( |
110 | [callback]() { | 111 | [callback, commandId]() { |
112 | Trace() << "Command pipeline processed: " << Akonadi2::Commands::name(commandId); | ||
111 | callback(true); | 113 | callback(true); |
112 | }, | 114 | }, |
113 | [callback](int errorCode, QString errorMessage) { | 115 | [callback](int errorCode, QString errorMessage) { |