diff options
Diffstat (limited to 'common/genericresource.cpp')
-rw-r--r-- | common/genericresource.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/genericresource.cpp b/common/genericresource.cpp index 4abcecd..acf84c4 100644 --- a/common/genericresource.cpp +++ b/common/genericresource.cpp | |||
@@ -204,10 +204,11 @@ void GenericResource::enqueueCommand(MessageQueue &mq, int commandId, const QByt | |||
204 | void GenericResource::processCommand(int commandId, const QByteArray &data) | 204 | void GenericResource::processCommand(int commandId, const QByteArray &data) |
205 | { | 205 | { |
206 | static int modifications = 0; | 206 | static int modifications = 0; |
207 | const int batchSize = 100; | ||
207 | mUserQueue.startTransaction(); | 208 | mUserQueue.startTransaction(); |
208 | enqueueCommand(mUserQueue, commandId, data); | 209 | enqueueCommand(mUserQueue, commandId, data); |
209 | modifications++; | 210 | modifications++; |
210 | if (modifications >= 100) { | 211 | if (modifications >= batchSize) { |
211 | mUserQueue.commit(); | 212 | mUserQueue.commit(); |
212 | modifications = 0; | 213 | modifications = 0; |
213 | mCommitQueueTimer.stop(); | 214 | mCommitQueueTimer.stop(); |