Commit ecf730e2 authored by Sebastian Kummer's avatar Sebastian Kummer

Merge pull request #23 in ZO/z-push from bugfix/ZO-123-typo-in-config to develop

* commit '0a991106':
  ZO-123 Fixed typo of AMOUNT_OF_CHUNKS.
parents 59b9919a 0a991106
......@@ -12,7 +12,7 @@
// The field to be hashed that is unique and never changes
// in the entire lifetime of the GAB entry.
define('HASHFIELD', 'account');
define('AMOUT_OF_CHUNKS', 10);
define('AMOUNT_OF_CHUNKS', 10);
// SyncWorker implementation to be used
define('SYNCWORKER', 'Zarafa');
......
......@@ -19,7 +19,7 @@ abstract class SyncWorker {
* The constructer should do all required login actions.
*/
public function __construct() {
$this->chunkType = @constant("HASHFIELD") . "-" . @constant("AMOUT_OF_CHUNKS");
$this->chunkType = @constant("HASHFIELD") . "-" . @constant("AMOUNT_OF_CHUNKS");
$this->hashFieldId = @constant("HASHFIELD");
}
......@@ -114,7 +114,7 @@ abstract class SyncWorker {
$l = sprintf("\nSync:\n\tItems in GAB:\t\t\t%d\n\tTotal data size: \t\t%d B\n\n", count($gab), $bytes);
$l .= sprintf("\tAvg. of items per chunk: \t%g\n\tMin. of items per chunk: \t%d\n\tMax. of items per chunk: \t%d\n\n", ($entries/count($chunks)), $minEntries, $maxEntries);
$l .= sprintf("\tAvg. of size per chunk: \t%d B\n\tMin. of size per chunk: \t%d B\n\tMax. of size per chunk: \t%d B\n\n", ($bytes/count($chunks)), $minSize, $maxSize);
$l .= sprintf("\tConfigured amout of chunks:\t%d\n\tIdeal amount by entries: \t%d\n\tIdeal amount by size: \t\t%d", AMOUT_OF_CHUNKS, $idealByEntries, $idealBySize);
$l .= sprintf("\tConfigured amout of chunks:\t%d\n\tIdeal amount by entries: \t%d\n\tIdeal amount by size: \t\t%d", AMOUNT_OF_CHUNKS, $idealByEntries, $idealBySize);
$this->Log($l);
}
......@@ -298,7 +298,7 @@ abstract class SyncWorker {
*/
protected function calculateChunkId($value) {
$hash = sprintf("%u", crc32($value));
return fmod($hash, AMOUT_OF_CHUNKS);
return fmod($hash, AMOUNT_OF_CHUNKS);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment