As a REST API consumer, the job status relevant to you are: 1. EDITING -- this is the status when you create a job via /molpro/jobs API
2. ORDER_SUBMITTED, ORDER_PROCESSING,AWAITING_PRODUCTION -- this is the status after you call /molpro/jobs/submit. Typically you get AWAITING_PRODUCTION but if the server is busy, it might take a few seconds for the status to go from ORDER_SUBMITTED -> ORDER_PROCESSING -> AWAITING_PRODUCTION
3. IN_PRODUCTION -- this is the status sometime after 8 PM EST when the job is sent to the printer. Typically this will be the status no later than 9 PM EST. Note that IN_PRODUCTION can happen earlier during the day, like even at 5 PM because if we have sufficient mail to send to the printer earlier during the day, we send it off sooner.
- MAILED -- this is the status after the mail has been handed off to USPS. Typically mail is handed off by noon the next day, but the status update happens at 5 PM.
- ERROR -- if anything goes wrong
Note that For priority and express mail jobs, the transition from AWAITING_PRODUCTION --> IN_PRODUCTION happens within minutes. These jobs do not wait for 8 PM. They process immediately. The MAILED status for these jobs depends on what time you put the jobs in. There are 2-3 windows during the day when USPS accepts Priority and Express mail. So we give it to USPS at the earliest window.
Checking status I would recommend that instead of constantly checking job status, you do it as follows:
- After you call /submit make sure the job status is AWAITING_PRODUCTION. If not, pause for like 2 minutes and check again. If it is still not in AWAITING_PRODUCTION send a notification alert.
- Check at say 10 PM to make sure job is in status IN_PRODUCTION
- Check at say 6 PM to make sure the job is in MAILED status.
For Priority and Express mail, make sure it is in IN_PRODUCTION status 5 minutes after calling /jobs/submit.
Finally, please always check for the ERROR status so you know if anything failed.
Error handling
Occasionally, a REST API call can fail due to intermittent network or server issues. So anytime you make a REST API call, please check for Http Response Code. If you get a 5XX code, please pause 60 sec and try again. We recommend trying 5 times before giving up. Usually intermittent server issues self-resolve in 1 minute and definitely in 5 minutes.
Carly Brown
Comments