Skip to content

Commit

Permalink
refactor(packagist): Use single cache namespace (#31053)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Aug 27, 2024
1 parent 6899eb0 commit c7026f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/modules/datasource/packagist/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ export class PackagistDatasource extends Datasource {
}

@cache({
namespace: `datasource-${PackagistDatasource.id}-public-files`,
namespace: `datasource-${PackagistDatasource.id}`,
key: (regUrl: string, regFile: RegistryFile) =>
PackagistDatasource.getPackagistFileUrl(regUrl, regFile),
`getPackagistFile:${PackagistDatasource.getPackagistFileUrl(regUrl, regFile)}`,
cacheable: (regUrl: string) =>
!PackagistDatasource.isPrivatePackage(regUrl),
ttlMinutes: 1440,
Expand Down Expand Up @@ -125,9 +125,9 @@ export class PackagistDatasource extends Datasource {
}

@cache({
namespace: `datasource-${PackagistDatasource.id}-org`,
namespace: `datasource-${PackagistDatasource.id}`,
key: (registryUrl: string, metadataUrl: string, packageName: string) =>
`${registryUrl}:${metadataUrl}:${packageName}`,
`packagistV2Lookup:${registryUrl}:${metadataUrl}:${packageName}`,
ttlMinutes: 10,
})
async packagistV2Lookup(
Expand Down
2 changes: 0 additions & 2 deletions lib/util/cache/package/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ export type PackageCacheNamespace =
| 'datasource-npm:data'
| 'datasource-nuget-v3'
| 'datasource-orb'
| 'datasource-packagist-org'
| 'datasource-packagist-public-files'
| 'datasource-packagist'
| 'datasource-pod'
| 'datasource-python-version'
Expand Down

0 comments on commit c7026f6

Please sign in to comment.