Skip to content

Commit

Permalink
fix php sleep warning
Browse files Browse the repository at this point in the history
  • Loading branch information
KiboOst committed Dec 30, 2020
1 parent 30c961a commit 472300d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/class/scenarioExpression.class.php
Expand Up @@ -1307,13 +1307,13 @@ public function execute(&$scenario = null) {
} elseif ($this->getExpression() == 'sleep') {
if (isset($options['duration'])) {
try {
$options['duration'] = floatval(evaluate($options['duration']));
$options['duration'] = intval(evaluate($options['duration']));
} catch (Exception $e) {

} catch (Error $e) {

}
if (is_numeric($options['duration']) && $options['duration'] > 0) {
if (is_int($options['duration']) && $options['duration'] > 0) {
$this->setLog($scenario, __('Pause de ', __FILE__) . $options['duration'] . __(' seconde(s)', __FILE__));
if ($options['duration'] < 1) {
usleep($options['duration'] * 1000000);
Expand Down

0 comments on commit 472300d

Please sign in to comment.