Closed dominicbarnes closed 8 years ago
Hm, I thought the inflight
stuff in duojs/package handled this.
That only deals with the tar download. Resolve had no caching in this regard.
I had to put out a fire, since the number of API requests was exceeding the rate-limit because of this issue. But I can explain more of the rationale this evening. :)
Ahh gotcha no that makes sense, since we're pinging the API now for resolves.
It turns out that in complex projects, it's not hard to hit the API limit. I've discovered that packages are being resolved over and over again.
Since they are kicked off asynchronously, there's not an indication that the given package is already being resolved. (particularly if there are multiple pkg objects referencing the same package)
This changes it so that they same
pkg
object will be used in cases where theslug
is identical. I'll also be adding changes toduo-package
so that it also knows when the package is already in flight. (similar to how it checks before downloading)