Closed jablko closed 3 years ago
Looks fine, but did you ensure that it has some expiration too? (I think that the function interface can keep the code running for a long periods.)
No, I don't think there's currently any expiration? timeoutMs
is Infinity
: https://github.com/DefinitelyTyped/dt-mergebot/blob/1a641371d7dc235ee05a0b1239ad8aa60d3f7b4d/src/util/cachedQueries.ts#L10
I revised the title/description to specify this is only for values we are already caching: labels/project columns.
I was asking about the apollo cache -- it might have been nice to be able to set a timeout to use more caching, though I can't remember now if there are queries that need that.
It seems like we're disabling Apollo caching (
fetchPolicy: "network-only"
) only to cache the labels/project columns ourselves. Because our cache lifetime isInfinity
, can we just use the default Apollo fetch policy in this case?I confirmed that it fetches
GetProjectColumns
/GetLabels
only once, before and after this change.