Handle the fact that a user can be removed but have feeds in queue
This commit is contained in:
parent
13a6d0797f
commit
856f5fc02f
20
worker.php
20
worker.php
@ -19,16 +19,22 @@ while ($job = $connection->reserveFromTube(BEANSTALKD_QUEUE)) {
|
|||||||
$start_time = microtime(true);
|
$start_time = microtime(true);
|
||||||
|
|
||||||
echo 'Processing feed_id=', $payload['feed_id'], ' for user_id=', $payload['user_id'];
|
echo 'Processing feed_id=', $payload['feed_id'], ' for user_id=', $payload['user_id'];
|
||||||
|
$user = Model\User\get_user_by_id($payload['user_id']);
|
||||||
|
|
||||||
$session->flush();
|
if (empty($user)) {
|
||||||
$session->setUser(Model\User\get_user_by_id($payload['user_id']));
|
echo ', user not found (removed?)'.PHP_EOL;
|
||||||
|
} else {
|
||||||
|
$session->flush();
|
||||||
|
$session->setUser($user);
|
||||||
|
|
||||||
Handler\Feed\update_feed($payload['user_id'], $payload['feed_id']);
|
Handler\Feed\update_feed($payload['user_id'], $payload['feed_id']);
|
||||||
Model\Item\autoflush_read($payload['user_id']);
|
Model\Item\autoflush_read($payload['user_id']);
|
||||||
Model\Item\autoflush_unread($payload['user_id']);
|
Model\Item\autoflush_unread($payload['user_id']);
|
||||||
|
|
||||||
echo ', duration='.(microtime(true) - $start_time).' seconds', PHP_EOL;
|
echo ', duration='.(microtime(true) - $start_time).' seconds', PHP_EOL;
|
||||||
|
|
||||||
|
Miniflux\Helper\write_debug_file();
|
||||||
|
}
|
||||||
|
|
||||||
Miniflux\Helper\write_debug_file();
|
|
||||||
$connection->delete($job);
|
$connection->delete($job);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user