The archive process for access tokens in CouchDB

Details

Description

Javi and Alfredo noticed today on Jan 16, 2019 that there are exactly 185534 access token documents in the staging server CouchDB (inexactly 19k in production). This large number of access token documents is normal because:

1. The cloud responds with a new access token for every request to /access_token endpoint, even if the request is for the same gpiiKey + clientCredential combination;
2. Every access token is valid for 60 mins. When one access token is expired for a key-in, Morphic will silently request a new access token behind the scenes.

We may hit the issue on the production with the CouchDB requesting large volume of storage due to this access token generation process