DefinitelyTyped / dt-mergebot

The bot which handles auto-merging your PRs
https://devblogs.microsoft.com/typescript/changes-to-how-we-manage-definitelytyped/
MIT License
112 stars 44 forks source link

Use Apollo cache for labels/project columns #356

Closed jablko closed 3 years ago

jablko commented 3 years ago

It seems like we're disabling Apollo caching (fetchPolicy: "network-only") only to cache the labels/project columns ourselves. Because our cache lifetime is Infinity, 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.

elibarzilay commented 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.)

jablko commented 3 years ago

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

jablko commented 3 years ago

I revised the title/description to specify this is only for values we are already caching: labels/project columns.

elibarzilay commented 3 years ago

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.