Fire a code when permalinks updated

I would like to execute some php code when permalinks updated, I think some plugins I’m using them updates permalinks programmatically sometime and this breaks my some slug rewrite settings, at this point I need to run code when permalinks updated. Is there any filter or event listener to make me able to this.