The vehicle real-time snapshot download is initiated when accessing a vehicle in LubeSoft. No download attempt is made if there is a pending shadow record for the vehicle or if the vehicle exists in the local database, but does not have a unique ID. If download requirements are met, the vehicle’s ID is written to a temporary file following the pattern /tmp/[random number]veh. The script /opt/isi/web-central/lubesoft-sharing/scripts/vehicle-snapshot is called with the temporary file path as the parameter. The vehicle-snapshot script reads the vehicle’s ID from the temporary file and makes a request to the isi-lubesoft-sharing service.
The lubesoft-sharing process looks up the vehicle’s unique ID if it exists (or the LubeSoft vehicle ID if no unique ID exists as with a newly created vehicle) and sends a request to the upload-server for the latest vehicle information. The upload-server creates a collection of vehicle data and any deleted vehicles related to the requested vehicle and responds with this collection. The lubesoft-sharing service receives the vehicle data and updates the store database. Deleted vehicles are processed first. Existing vehicle data is completely overwritten with the data from ISI Central. The lubesoft-sharing process responds to the download request with the record number of the downloaded vehicle and some deletion or merge information if any exists. The vehicle-snapshot script then writes this data into the original temporary file.
After the download completes, LubeSoft reads the vehicle record number from the temporary file and loads that record’s data. If the download caused a change ID, LubeSoft will update inf1cc with the new vehicle ID. If the download did not find a vehicle or the vehicle was deleted, the record number returned by lubesoft-sharing will be 0. If there is a communications error during this process, it will timeout after about 5 seconds.
If the lubesoft-sharing service is unable to communicate with ISI Central during the real-time data download, an offline status is set in the service. When this status is set, the bay and greeter stations will display an offline notification message at the top of the screen and the real-time downloads will not send requests to ISI Central. At the time the offline status is set, an automated process starts, which attempts to connect to the ISI Central server every five minutes. If this automated process is able to connect, the offline status is removed and the automated check process is stopped. The offline status may only be removed via the automated check process and eventual restarting the isi-lubesoft-sharing service.