Issue with Jira API integration: Updating Refresh Token after Periods of Inactivity

In my code, I’ve integrated with the Jira site using the API https://auth.atlassian.com/oauth/token . The logic in my code aims to update the refresh token after 15 days of token inactivity and store this new refresh token for subsequent use. However, I’ve encountered an issue where, after a certain period of inactivity, my application disconnects from the Jira site. Could you please assist me in identifying the potential issues within my code that might be causing this disconnection?