Skip to content

Commit

Permalink
refactor(go): Use single cache namespace (#31039)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kriese <[email protected]>
  • Loading branch information
zharinov and viceice committed Aug 27, 2024
1 parent 674b757 commit c2f2d4f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 4 additions & 3 deletions lib/modules/datasource/go/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ export class GoDatasource extends Datasource {
@cache({
namespace: `datasource-${GoDatasource.id}`,
// TODO: types (#22198)
key: ({ packageName }: Partial<DigestConfig>) => `${packageName}-digest`,
key: ({ packageName }: GetReleasesConfig) =>
`getReleases:${packageName}-digest`,
})
getReleases(config: GetReleasesConfig): Promise<ReleaseResult | null> {
return this.goproxy.getReleases(config);
Expand All @@ -65,8 +66,8 @@ export class GoDatasource extends Datasource {
* - Call the respective getDigest in github to retrieve the commit hash
*/
@cache({
namespace: GoDatasource.id,
key: ({ packageName }: DigestConfig) => `${packageName}-digest`,
namespace: `datasource-${GoDatasource.id}`,
key: ({ packageName }: DigestConfig) => `getDigest:${packageName}-digest`,
})
override async getDigest(
{ packageName }: DigestConfig,
Expand Down
1 change: 0 additions & 1 deletion lib/util/cache/package/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ export type PackageCacheNamespace =
| 'datasource-unity3d'
| 'github-releases-datasource-v2'
| 'github-tags-datasource-v2'
| 'go'
| 'merge-confidence'
| 'preset'
| 'url-sha256';
Expand Down

0 comments on commit c2f2d4f

Please sign in to comment.