Laravel queue problem

now there is a requirement for the project to obtain order data from ebay and import it into the database. At first, the order data is obtained through the interface, and then the data is placed in the queue and inserted into the database. Now I want to put the data from the calling interface in the queue, but I have some problems.

$service = new TradingService([
                    "credentials" => [
                        "appId" => $val["appId"],
                        "certId" => $val["certId"],
                        "devId" => $val["devId"],
                    ],
                    "authToken" => $val["password"],
                    "siteId" => Constants\SiteIds::US
                ]);

                $datetime = new \DateTime("-1 day");
                $datetimeend = new \DateTime("-1 day");
                $startdate = $datetime->setTime(0, 0, 0);
                $enddate  = $datetimeend->setTime(23, 59, 59);

                $args = array(
                    "OrderStatus"   => "All",
//                    "OrderStatus"   => "Completed",
                    "SortingOrder"  => "Ascending",
                    "OrderRole"     => "Seller",

                    //"CreateTimeFrom"   => new \DateTime("2015-01-01"),

                    "CreateTimeFrom"   => $startdate,
                    "CreateTimeTo"   => $enddate,
                );

                $request = new \DTS\eBaySDK\Trading\Types\GetOrdersRequestType($args);
                $request->RequesterCredentials = new \DTS\eBaySDK\Trading\Types\CustomSecurityHeaderType();
                $request->RequesterCredentials->eBayAuthToken =  $val["password"];
                $request->IncludeFinalValueFee = true;
                $request->Pagination = new \DTS\eBaySDK\Trading\Types\PaginationType();
                $request->Pagination->EntriesPerPage = 100;
                $pageNum = 1;

                $orders = [];

                do {
                    $request->Pagination->PageNumber = $pageNum;

                    $response = $service->getOrders($request);

                    if (isset($response->Errors)) {

                        $message = "";

                        foreach ($response->Errors as $error) {
                            $message .= $error->ShortMessage;
                        }

                        throw new \Exception($message);
                    }

                    if ($response->Ack !== "Failure" && isset($response->OrderArray)) {
                        foreach ($response->OrderArray->Order as $order) {
                            $orders[] = $order->toArray();
                        }
                    }

                    $pageNum += 1;
                }
                while(isset($response->OrderArray) && $pageNum <= $response->PaginationResult->TotalNumberOfPages);

of course, this code is fine if it is placed in the controller.
but after putting the above code in the handle of the queue, the queue will not be able to execute normally

clipboard.png
I don"t know what I wrote wrong? Or can the queue not operate like this in the first place? And ask the expert to give us some advice.

Mar.03,2021

check the log

where did $request come from

Menu