Skip to content

Commit

Permalink
feat: Support cachePrivatePackages for Maven datasource (#30126)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Jul 12, 2024
1 parent 34c56e3 commit 7c7063d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/modules/datasource/maven/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import is from '@sindresorhus/is';
import { DateTime } from 'luxon';
import type { XmlDocument } from 'xmldoc';
import { GlobalConfig } from '../../../config/global';
import { logger } from '../../../logger';
import * as packageCache from '../../../util/cache/package';
import { filterMap } from '../../../util/filter-map';
Expand Down Expand Up @@ -110,7 +111,11 @@ export class MavenDatasource extends Datasource {
(acc, version) => ({ ...acc, [version]: null }),
{},
);
if (isCacheable) {
const cachePrivatePackages = GlobalConfig.get(
'cachePrivatePackages',
false,
);
if (cachePrivatePackages || isCacheable) {
await packageCache.set(cacheNamespace, cacheKey, releaseMap, 30);
}
return releaseMap;
Expand Down

0 comments on commit 7c7063d

Please sign in to comment.