Fix sync command

This commit is contained in:
Timothy Warren 2020-08-17 18:08:58 -04:00
parent 9b4c9ad76f
commit c749c7c923
3 changed files with 19 additions and 23 deletions

View File

@ -48,7 +48,7 @@ final class Model {
use MangaTrait; use MangaTrait;
use MutationTrait; use MutationTrait;
protected const LIST_PAGE_SIZE = 100; protected const LIST_PAGE_SIZE = 75;
/** /**
* @var ListItem * @var ListItem
@ -367,7 +367,7 @@ final class Model {
'kind' => $type, 'kind' => $type,
], ],
'include' => "{$type},{$type}.mappings", 'include' => "{$type},{$type}.mappings",
'sort' => '-updated_at' // 'sort' => '-updated_at'
]; ];
return $this->getRawSyncList($type, $options); return $this->getRawSyncList($type, $options);

View File

@ -362,16 +362,19 @@ final class RequestBuilder extends APIRequestBuilder {
// Any other type of failed request // Any other type of failed request
if ($statusCode > 299 || $statusCode < 200) if ($statusCode > 299 || $statusCode < 200)
{
if ($logger)
{ {
$logger->warning('Non 2xx response for api call', (array)$response); $logger->warning('Non 2xx response for api call', (array)$response);
} }
dump($rawBody);
die();
// throw new FailedResponseException('Failed to get the proper response from the API');
}
try
{
return Json::decode($rawBody); return Json::decode($rawBody);
} }
catch (JsonException $e)
{
// dump($e);
dump($rawBody);
die();
}
}
} }

View File

@ -54,8 +54,6 @@ abstract class BaseCommand extends Command {
$message = implode("\n", $message); $message = implode("\n", $message);
} }
try
{
// color message // color message
$message = Colors::colorize($message, $fgColor, $bgColor); $message = Colors::colorize($message, $fgColor, $bgColor);
@ -66,11 +64,6 @@ abstract class BaseCommand extends Command {
echo "\n"; echo "\n";
} }
catch (ConsoleException $e)
{
// oops
}
}
public function echo(string $message): void public function echo(string $message): void
{ {