When a certain threshold of orders are printed via our app in a short period (for example, 12 orders in 5 minutes), the printers simply stop working. No exceptions are thrown, no errors appear and nothing displays in the print queue. When we close and re-open the software, the issue persists. At some point it clears up and printing works again.
Are there any sort of internal limitations to OrderConnector.Fire and StaticBillPrintJobs? What could cause such strange behavior?
We didn't even notice this until we recently got a higher volume customer that was having printing issues for online orders, but no errors of any kind were displaying. We determined that the notifications were being received as data was being sent back to our server indicating so. Completely confused by this, I attempted a test of my own in the sandbox to reproduce their conditions. I tested 20 orders at random 5-60 second intervals, and the kitchen slip and payment receipt printed on the first 12. After that, the app notes that it receives an order and attempts to print, but no exceptions are thrown, there are no errors in the notification area, and nothing displays in the print queue. Each order was identical in contents and are confirmed to have been correctly received by Clover. The orders can also be seen in the clover order history. Closing and re-opening the app does not allow it to begin printing again. It appears that this issue only appears during higher volume times, as we have done plenty of order tests in the past without this issue (although probably not as frequent in a short span as today's test).
Here is the code that is inside the try block. This code works until used somewhat frequently as indicated above:
mAccount = CloverAccount.getAccount(MainActivity.this);
// PRINT KITCHEN
orderConnector = new OrderConnector(MainActivity.this, mAccount, null);
orderConnector.connect();
orderConnector.fire(order_id);
orderConnector.disconnect();
// PRINT RECEIPT
PrintJob pj = new StaticBillPrintJob.Builder().order(orderConnector.getOrder(order_id)).build();
pj.print(MainActivity.this, mAccount);
// PRINT KITCHEN
orderConnector = new OrderConnector(MainActivity.this, mAccount, null);
orderConnector.connect();
orderConnector.fire(order_id);
orderConnector.disconnect();
// PRINT RECEIPT
PrintJob pj = new StaticBillPrintJob.Builder().order(orderConnector.getOrder(order_id)).build();
pj.print(MainActivity.this, mAccount);
Any ideas with regards to how I might approach solving this issue? Am I doing something wrong?