Skip to content

Commit 4a6088a

Browse files
nickvergessenbackportbot[bot]
authored andcommitted
perf(workflows): Fix cache in request time check
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 8c72bf9 commit 4a6088a

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

apps/workflowengine/lib/Check/RequestTime.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333
*/
3434
#[\Override]
3535
public function executeCheck($operator, $value) {
36-
$valueHash = md5($value);
36+
$valueHash = sha1($operator . $value);
3737

3838
if (isset($this->cachedResults[$valueHash])) {
3939
return $this->cachedResults[$valueHash];
@@ -51,7 +51,10 @@ public function executeCheck($operator, $value) {
5151
$in = $timestamp1 <= $timestamp || $timestamp <= $timestamp2;
5252
}
5353

54-
return ($operator === 'in') ? $in : !$in;
54+
$result = ($operator === 'in') ? $in : !$in;
55+
56+
$this->cachedResults[$valueHash] = $result;
57+
return $result;
5558
}
5659

5760
/**

0 commit comments

Comments
 (0)