File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed
lib/modules/platform/bitbucket Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { parseJson } from '../../../util/common';
77import * as git from '../../../util/git' ;
88import * as hostRules from '../../../util/host-rules' ;
99import { BitbucketHttp , setBaseUrl } from '../../../util/http/bitbucket' ;
10+ import { repoCacheProvider } from '../../../util/http/cache/repository-http-cache-provider' ;
1011import type { HttpOptions } from '../../../util/http/types' ;
1112import { regEx } from '../../../util/regex' ;
1213import { sanitize } from '../../../util/sanitize' ;
@@ -163,7 +164,10 @@ export async function getRawFile(
163164 `/2.0/repositories/${ repo } /src/` +
164165 ( finalBranchOrTag ?? `HEAD` ) +
165166 `/${ path } ` ;
166- const res = await bitbucketHttp . get ( url ) ;
167+ const res = await bitbucketHttp . get ( url , {
168+ cacheProvider : repoCacheProvider ,
169+ memCache : true ,
170+ } ) ;
167171 return res . body ;
168172}
169173
Original file line number Diff line number Diff line change @@ -74,6 +74,7 @@ describe('modules/platform/bitbucket/pr-cache', () => {
7474 } ,
7575 ] ) ;
7676 expect ( cache ) . toEqual ( {
77+ httpCache : { } ,
7778 platform : {
7879 bitbucket : {
7980 pullRequestsCache : {
@@ -120,6 +121,7 @@ describe('modules/platform/bitbucket/pr-cache', () => {
120121 { number : 2 , title : 'title' } ,
121122 ] ) ;
122123 expect ( cache ) . toEqual ( {
124+ httpCache : { } ,
123125 platform : {
124126 bitbucket : {
125127 pullRequestsCache : {
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { logger } from '../../../logger';
44import * as memCache from '../../../util/cache/memory' ;
55import { getCache } from '../../../util/cache/repository' ;
66import type { BitbucketHttp } from '../../../util/http/bitbucket' ;
7+ import { repoCacheProvider } from '../../../util/http/cache/repository-http-cache-provider' ;
78import type { Pr } from '../types' ;
89import type { BitbucketPrCacheData , PagedResult , PrResponse } from './types' ;
910import { prFieldsFilter , prInfo , prStates } from './utils' ;
@@ -128,7 +129,11 @@ export class BitbucketPrCache {
128129 private async sync ( http : BitbucketHttp ) : Promise < BitbucketPrCache > {
129130 logger . debug ( 'Syncing PR list' ) ;
130131 const url = this . getUrl ( ) ;
131- const opts = { paginate : true , pagelen : 50 } ;
132+ const opts = {
133+ paginate : true ,
134+ pagelen : 50 ,
135+ cacheProvider : repoCacheProvider ,
136+ } ;
132137 const res = await http . getJson < PagedResult < PrResponse > > ( url , opts ) ;
133138 this . reconcile ( res . body . values ) ;
134139 return this ;
You can’t perform that action at this time.
0 commit comments