Skip to content

Commit

Permalink
refactor(BitBucketTags): cache for 30m instead of 10m and use datasou…
Browse files Browse the repository at this point in the history
…rce id as cache namespace
  • Loading branch information
secustor committed Jul 27, 2021
1 parent 4a2fe51 commit 88980ef
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/datasource/bitbucket-tags/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class BitBucketTagsDatasource extends Datasource {

static readonly defaultRegistryUrls = ['https://bitbucket.org'];

static readonly cacheNamespace = 'datasource-bitbucket';
static readonly cacheNamespace = `datasource-${BitBucketTagsDatasource.id}`;

constructor() {
super(BitBucketTagsDatasource.id);
Expand All @@ -39,7 +39,6 @@ export class BitBucketTagsDatasource extends Datasource {
namespace: BitBucketTagsDatasource.cacheNamespace,
key: ({ registryUrl, lookupName }: GetReleasesConfig) =>
BitBucketTagsDatasource.getCacheKey(registryUrl, lookupName, 'tags'),
ttlMinutes: 10,
})
async getReleases({
registryUrl,
Expand Down Expand Up @@ -72,7 +71,6 @@ export class BitBucketTagsDatasource extends Datasource {
namespace: BitBucketTagsDatasource.cacheNamespace,
key: (registryUrl, repo, tag: string) =>
BitBucketTagsDatasource.getCacheKey(registryUrl, repo, `tag-${tag}`),
ttlMinutes: 10,
})
async getTagCommit(
registryUrl: string,
Expand Down Expand Up @@ -107,7 +105,6 @@ export class BitBucketTagsDatasource extends Datasource {
namespace: BitBucketTagsDatasource.cacheNamespace,
key: ({ registryUrl, lookupName }: DigestConfig) =>
BitBucketTagsDatasource.getCacheKey(registryUrl, lookupName, 'digest'),
ttlMinutes: 10,
})
async getDigest(
{ lookupName: repo, registryUrl }: DigestConfig,
Expand Down

0 comments on commit 88980ef

Please sign in to comment.