Fix #10.
This commit is contained in:
parent
94129f3b5c
commit
5bb8c64c98
|
@ -67,12 +67,23 @@ class UpdateSubscriptionsCommand extends ContainerAwareCommand
|
|||
try {
|
||||
$serviceSubscribers = $api->getUserSubscribersById($serviceUserId);
|
||||
} catch (\Exception $e) {
|
||||
// @todo fallback to the local subscribers list
|
||||
$output->writeln('Error while getting service subscribers');
|
||||
$log->error('Error while getting service subscribers.', ['user_login' => $serviceUser->getLogin(), 'user_id' => $serviceUser->getId(), 'message' => $e->getMessage(), 'file' => $e->getFile(), 'line' => $e->getLine()]);
|
||||
|
||||
$serviceSubscribers = [];
|
||||
|
||||
foreach ($serviceUser->getSubscribers() as $subscription) {
|
||||
$serviceSubscribers[] = $subscription->getSubscriber();
|
||||
}
|
||||
|
||||
$output->writeln('Fallback to local list');
|
||||
$log->error('Fallback to local list');
|
||||
|
||||
if (!count($serviceSubscribers)) {
|
||||
$log->info('No local subscribers. Finishing.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($output->isVerbose()) {
|
||||
$output->writeln('Updating service subscribers');
|
||||
|
|
|
@ -184,7 +184,7 @@ class User
|
|||
/**
|
||||
* Get subscribers
|
||||
*
|
||||
* @return ArrayCollection
|
||||
* @return Subscription[]|ArrayCollection
|
||||
*/
|
||||
public function getSubscribers()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue