From eaa988715068674281d4a30c78875e5e563af94c Mon Sep 17 00:00:00 2001 From: Netkas Date: Sun, 9 Jul 2023 11:48:25 -0400 Subject: [PATCH] `\TamerLib\tm > wait()` no longer throws a TimeoutException, the function will simply return when the timeout is reached. --- CHANGELOG.md | 7 +++++++ src/TamerLib/tm.php | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b4211d7..de2d66b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.1.2] - 2023-07-09 + +### Changed + - `\TamerLib\tm > wait()` no longer throws a TimeoutException, the function will simply return when the timeout is + reached. + + ## [2.1.1] - 2023-07-07 ### Fixed diff --git a/src/TamerLib/tm.php b/src/TamerLib/tm.php index cc2ac30..c65d6c1 100644 --- a/src/TamerLib/tm.php +++ b/src/TamerLib/tm.php @@ -456,7 +456,6 @@ * @throws JobManagerException If the JobManager throws an exception * @throws TamerException If the Tamer throws an exception * @throws Throwable If a job fails - * @throws TimeoutException If the timeout is reached */ public static function wait(int $timeout=0): void { @@ -548,12 +547,12 @@ if ($timeout < 0) { - throw new TimeoutException('wait() timed out'); + return; } if($timeout > 0 && (time() - $time_start) >= $timeout) { - throw new TimeoutException('wait() timed out'); + return; } usleep(1000);