miniflux-legacy/worker.php

19 lines
431 B
PHP
Raw Normal View History

2016-05-02 04:03:21 +02:00
<?php
use Pheanstalk\Pheanstalk;
require __DIR__.'/common.php';
if (php_sapi_name() !== 'cli') {
die('This script can run only from the command line.'.PHP_EOL);
}
2016-05-02 04:03:21 +02:00
$connection = new Pheanstalk(BEANSTALKD_HOST);
while ($job = $connection->reserveFromTube(BEANSTALKD_QUEUE)) {
$feed_id = $job->getData();
echo 'Processing feed_id='.$feed_id.PHP_EOL;
Model\Feed\refresh($feed_id);
$connection->delete($job);
}