projects
/
GitHub
/
WoltLab
/
WCF.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9db0c33
)
Preventing workers from counting the same objects over and over again
author
Alexander Ebert
<ebert@woltlab.com>
Mon, 29 Jul 2013 17:03:05 +0000
(19:03 +0200)
committer
Alexander Ebert
<ebert@woltlab.com>
Mon, 29 Jul 2013 17:03:05 +0000
(19:03 +0200)
wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php
patch
|
blob
|
blame
|
history
wcfsetup/install/files/lib/system/worker/AbstractWorker.class.php
patch
|
blob
|
blame
|
history
diff --git
a/wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php
b/wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php
index 89e634b1a9ebb6fb0bc348cfd83c1e217895809d..b6322d35f0c6179b75340941c51f1af1da80ce5d 100644
(file)
--- a/
wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php
+++ b/
wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php
@@
-56,7
+56,9
@@
abstract class AbstractRebuildDataWorker extends AbstractWorker implements IRebu
* @see wcf\system\worker\IWorker::countObjects()
*/
public function countObjects() {
- $this->count = $this->objectList->countObjects();
+ if ($this->count === null) {
+ $this->count = $this->objectList->countObjects();
+ }
}
/**
diff --git
a/wcfsetup/install/files/lib/system/worker/AbstractWorker.class.php
b/wcfsetup/install/files/lib/system/worker/AbstractWorker.class.php
index 0d21bc60ae6b8ab2b260ffc3bb63599d2ba726a4..1c4305a2b59d7d9b0eac0a6d3e3629c3ddd75764 100644
(file)
--- a/
wcfsetup/install/files/lib/system/worker/AbstractWorker.class.php
+++ b/
wcfsetup/install/files/lib/system/worker/AbstractWorker.class.php
@@
-16,7
+16,7
@@
abstract class AbstractWorker implements IWorker {
* count of total actions (limited by $limit per loop)
* @var integer
*/
- protected $count =
0
;
+ protected $count =
null
;
/**
* limit of actions per loop