mirror of
https://github.com/idanoo/php-resque
synced 2025-07-01 05:32:20 +00:00
Added a PREFIX environment variable to set the Resque prefix
This commit is contained in:
parent
cd85e8be85
commit
01c291f367
2 changed files with 14 additions and 0 deletions
|
@ -223,6 +223,13 @@ the `COUNT` environment variable:
|
||||||
|
|
||||||
$ COUNT=5 bin/resque
|
$ COUNT=5 bin/resque
|
||||||
|
|
||||||
|
### Custom prefix ###
|
||||||
|
|
||||||
|
When you have multiple apps using the same Redis database it is better to
|
||||||
|
use a custom prefix to separate the Resque data:
|
||||||
|
|
||||||
|
$ PREFIX=my-app-name bin/resque
|
||||||
|
|
||||||
### Forking ###
|
### Forking ###
|
||||||
|
|
||||||
Similarly to the Ruby versions, supported platforms will immediately
|
Similarly to the Ruby versions, supported platforms will immediately
|
||||||
|
@ -371,3 +378,4 @@ Called after a job has been queued using the `Resque::enqueue` method. Arguments
|
||||||
* Matt Heath
|
* Matt Heath
|
||||||
* jjfrey
|
* jjfrey
|
||||||
* scragg0x
|
* scragg0x
|
||||||
|
* ruudk
|
||||||
|
|
|
@ -71,6 +71,12 @@ if(!empty($COUNT) && $COUNT > 1) {
|
||||||
$count = $COUNT;
|
$count = $COUNT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$PREFIX = getenv('PREFIX');
|
||||||
|
if(!empty($PREFIX)) {
|
||||||
|
fwrite(STDOUT, '*** Prefix set to '.$PREFIX."\n");
|
||||||
|
Resque_Redis::prefix($PREFIX);
|
||||||
|
}
|
||||||
|
|
||||||
if($count > 1) {
|
if($count > 1) {
|
||||||
for($i = 0; $i < $count; ++$i) {
|
for($i = 0; $i < $count; ++$i) {
|
||||||
$pid = Resque::fork();
|
$pid = Resque::fork();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue