StarpTech / apollo-datasource-http

Optimized JSON HTTP Data Source for Apollo Server
MIT License
73 stars 32 forks source link

requestCache.maxTtl unit #22

Closed shkaper closed 2 years ago

shkaper commented 2 years ago

The comments in readme suggest that maxTtl and maxTtlIfError are in milliseconds

      requestCache: {
        maxTtl: 1000 * 60 * 10, // 10min, will respond for 10min with the cached result (updated every 10min)
        maxTtlIfError: 1000 * 60 * 30, // 30min, will respond with the cached response in case of an error (for further 20min)
      },

while the comments in the code say it's in seconds. I think the latter is correct, especially since apollo-server-caching mentions seconds, too.

StarpTech commented 2 years ago

Hi @shkaper seconds is correct. I updated the readme, thank you.