-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: unpkg lock #629
fix: unpkg lock #629
Conversation
d12d928
to
f4d416c
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #629 +/- ##
==========================================
- Coverage 97.45% 96.85% -0.60%
==========================================
Files 168 180 +12
Lines 15691 17567 +1876
Branches 2018 2290 +272
==========================================
+ Hits 15291 17014 +1723
- Misses 400 553 +153 ☔ View full report in Codecov by Sentry. |
@@ -50,8 +54,16 @@ export class PackageVersionFileService extends AbstractService { | |||
async #ensurePackageVersionFilesSync(pkgVersion: PackageVersion) { | |||
const hasFiles = await this.packageVersionFileRepository.hasPackageVersionFiles(pkgVersion.packageVersionId); | |||
if (!hasFiles) { | |||
await this.syncPackageVersionFiles(pkgVersion); | |||
const lockRes = await this.cacheAdapter.usingLock(`${pkgVersion.packageVersionId}:syncFiles`, 60, async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈哈,这个 api 设计没有 tryLock 那个好。
[skip ci] ## [3.49.3](v3.49.2...v3.49.3) (2023-12-25) ### Bug Fixes * unpkg lock ([#629](#629)) ([5a8a4eb](5a8a4eb))
ensurePackageVersionFilesSync
function, with a default timeout of 60 seconds.