Major improvements to the Photo synchronization process to handle a number of situations and improve the logging of these.
To reduce risk of throttling a pause (100ms) has been added for every get photo by email request OnTime makes to EWS.
When using Graph OnTime now uses Graph id instead of by email to handle cases where there is a difference between email and upn.
Improve handling of the refresh token while photo synchronisation is running.
Added more logs, especially about successful synchronisation of photos.
Changed get photo from two calls for different sizes of photos to one call and then resize in OnTime.
To reduce the possible impact of throttling issues, a sorting strategy has been implemented where photos for persons will be synchronised before photos for rooms, resources and shared desks. When synchronising persons the ones who do not yet have a photo will be synchronised first.
Added strategy to retry to get a photo with wait time after EWS return error - Try again later. After this a pause of 500 ms has been added.
Limited total time for Photo synchronisation to 4 hours.