wa0x6e / Cake-Resque

Resque plugin for CakePHP : for creating background jobs that can be processed offline later
MIT License
159 stars 56 forks source link

Shell and started workers don't use configured server #4

Closed mikeful closed 12 years ago

mikeful commented 12 years ago

Fix Shell configuration handling with changes to app/Plugin/Resque/Console/Command/ResqueShell.php around line 19:

// Get CakeResque plugin configuration and set backend settings
$resqueSettings = Configure::read('Resque');

$redisHost = $resqueSettings['Redis']['host'];
$redisPort = $resqueSettings['Redis']['port'];

Resque::setBackend($redisHost . ':' . $redisPort);
// End CakeResque plugin configuration handling

Fix PHP-Resque configuration handling with changes to app/Plugin/Resque/Lib/ResqueBootstrap.php around line 54:

// Get Redis config from plugin configuration and set environment variable for PHP-Resque
$resqueSettings = Configure::read('Resque');

$redisHost = $resqueSettings['Redis']['host'];
$redisPort = $resqueSettings['Redis']['port'];

putenv('REDIS_BACKEND=' . $redisHost . ':' . $redisPort);
// End Redis environment variable config
wa0x6e commented 12 years ago

Issue is real, but it's not the appropriate solution.

It should have been fixed in the commit d2e090e1de4b82bc641db82b4a0ddacd6fffb3cf

You just need to pass it to the resque.php as a Environment variable via theexec() command

Tell me if it didn't resolve the issue