Haven't checked the code. But, I suspect issues with running this as a
non-Ajax request. It should ideally be a background process initiated using
Ajax and should long poll the status to show progress on the ui. Last sync
time could be a nice indicator to store.