Compare commits

...

4 commits

4 changed files with 23 additions and 5 deletions

View file

@ -5,6 +5,21 @@ 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.5] - 2023-07-06
### Fixed
- `\TamerLib\tm > wait()` will output worker updates even if there are no jobs in the queue, this fixes a bug where
workers would not be updated if the client only calls `dof()`
## [2.1.4] - 2023-07-28
### Fixed
- `\TamerLib\Classes > JobManager > connect()` re-constructs the Redis client before connecting to the server.
## [2.1.3] - 2023-07-27
### Changed

View file

@ -22,7 +22,7 @@
"description": "TamerLib allows the execution of parallel tasks",
"company": "Nosial",
"copyright": "Copyright (c) 2022-2023 Nosial, All Rights Reserved",
"version": "2.1.3",
"version": "2.1.5",
"uuid": "a365e7d6-a1c0-11ed-b7c7-b9654ed9efa5"
},
"build": {

View file

@ -110,6 +110,8 @@
try
{
$this->redis_client = new Redis();
$this->redis_client->connect(
$this->server_configuration->getHost(),
$this->server_configuration->getPort()

View file

@ -464,25 +464,27 @@
throw new RuntimeException(sprintf('Attempting to wait() in \'%s\' mode, only clients can preform wait().', self::$mode));
}
$time_start = time();
self::monitor(-1);
if(count(self::$watching_jobs) === 0)
{
return;
}
$time_start = time();
$watching_jobs = self::$watching_jobs;
Log::verbose(Utilities::getName(), sprintf('Waiting for %s job(s) to complete', count($watching_jobs)));
while(true)
{
self::monitor(-1);
if(count($watching_jobs) === 0)
{
return;
}
self::monitor(-1);
$job_id = self::$job_manager->listenReturnChannel(self::$return_channel);
if(!in_array($job_id, $watching_jobs, false))
{
Log::debug(Utilities::getName(), sprintf('Job \'%s\' has returned, but is not in the watchlist', $job_id));
@ -491,7 +493,6 @@
}
$job_packet = self::$job_manager->getJob($job_id);
if(isset(self::$job_callbacks[$job_id]))
{
$callback = self::$job_callbacks[$job_id];