TaskContext::setPriority()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 5
ccs 3
cts 3
cp 1
rs 10
cc 1
nc 1
nop 1
crap 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Level23\Druid\Context;
5
6
class TaskContext extends Context implements ContextInterface
7
{
8
    /**
9
     * task lock timeout in millisecond. For more details, see Locking.
10
     * Default: 300000
11
     *
12
     * @param int $taskLockTimeout
13
     *
14
     * @return $this
15
     */
16 1
    public function setTaskLockTimeout(int $taskLockTimeout): self
17
    {
18 1
        $this->properties['taskLockTimeout'] = $taskLockTimeout;
19
20 1
        return $this;
21
    }
22
23
    /**
24
     * Different based on task types.
25
     * Defaults:
26
     * Realtime index task    75
27
     * Batch index task    50
28
     * Merge/Append/Compaction task    25
29
     * Other tasks    0
30
     *
31
     * @param int $priority
32
     *
33
     * @return $this
34
     */
35 10
    public function setPriority(int $priority): self
36
    {
37 10
        $this->properties['priority'] = $priority;
38
39 10
        return $this;
40
    }
41
}