23 lines
573 B
PHP
23 lines
573 B
PHP
<?php
|
|
|
|
define('PROJECT_ROOT', dirname(__DIR__, 3));
|
|
|
|
require_once PROJECT_ROOT . '/vendor/autoload.php';
|
|
|
|
$config = parse_ini_file(PROJECT_ROOT . '/rediscache.ini');
|
|
|
|
// Set the Redis backend for Resque
|
|
$redisUrl = sprintf(
|
|
'redis://%s:%s@%s:%d',
|
|
urlencode($config['username']),
|
|
urlencode($config['password']),
|
|
$config['host'],
|
|
intval($config['port'], 10)
|
|
);
|
|
\Resque::setBackend($redisUrl);
|
|
|
|
// Start the worker
|
|
$worker = new \Resque_Worker(['inbox']);
|
|
|
|
fwrite(STDOUT, "*** Starting worker for inbox queue\n");
|
|
$worker->work(10); // 10 seconds interval
|