cancel
Showing results for 
Search instead for 
Did you mean: 

How to check the synchronization is complted or not?

Former Member
0 Kudos

I have written a programme to synchronize the given items as given below. But always getting exception as still the synchronisation is running and can't check the result. Please help me how can I check the synchronisation is completed or not.

final SyncResult syncResult = catalogSynchronizationService.performSynchronization(listOfItems, syncItemJob, syncConfig);
if (syncResult.isFinished()) { result = new ActionResult<>(ActionResult.SUCCESS,null); Messagebox.show(result.getResultCode()); }

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member638520
Contributor
0 Kudos

Hi,

You can check if SyncItemJobModel is completed or not by checking if the job is running. You can do that by:

 yourSyncItemJob.getExecutions().stream().anyMatch(execution -> cronJobService.isRunning(execution))

CronJobService has isFinished method as well, so you can try this method too.

Regards

Lukasz