Skip to content

Commit

Permalink
Fix HFT round per day calculation in case of , expression
Browse files Browse the repository at this point in the history
  • Loading branch information
lucatacconi committed Mar 6, 2024
1 parent 63c263e commit 67ca6e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"twig/twig": "^3",

"crunzphp/crunz": ">=3.6.0 ^3",
"lorisleiva/cron-translator": "^0"
"lorisleiva/cron-translator": "^0",
"dragonmantank/cron-expression": "^3.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3"
Expand Down
4 changes: 2 additions & 2 deletions routes/api/task.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ static function (array $file) {
}else if(strpos($aFREQ_M, "/") !== false){
$round_hour = round(60 / str_replace("*/", "", $aFREQ_M));
}else if(strpos($aFREQ_M, ",") !== false){
$aINT = explode("-", $aFREQ_M);
$aINT = explode(",", $aFREQ_M);
$round_hour = count($aINT);
}

Expand All @@ -350,7 +350,7 @@ static function (array $file) {
}else if(strpos($aFREQ_H, "/") !== false){
$round_day = round(24 / str_replace("*/", "", $aFREQ_H)) * $round_hour;
}else if(strpos($aFREQ_H, ",") !== false){
$aINT = explode("-", $aFREQ_H);
$aINT = explode(",", $aFREQ_H);
$round_day = count($aINT) * $round_hour;
}

Expand Down

0 comments on commit 67ca6e2

Please sign in to comment.