How to refresh Activity Log?

Is there any way to refresh the activity log section in a document? Actually, I added a comment through code, but after that, it is not showing until I reload the page.