Skip to content

Commit 995765b

Browse files
committed
actually skip cache
1 parent 671b1ee commit 995765b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

packages/@aws-cdk/toolkit-lib/lib/api/notices/web-data-source.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,21 @@ export class WebsiteNoticeDataSource implements NoticeDataSource {
4747
public readonly url: any;
4848

4949
private readonly agent?: https.Agent;
50+
private readonly skipNetworkCache?: boolean;
5051

5152
constructor(private readonly ioHelper: IoHelper, props: WebsiteNoticeDataSourceProps = {}) {
5253
this.agent = props.agent;
5354
this.url = props.url ?? 'https://cli.cdk.dev-tools.aws.dev/notices.json';
55+
this.skipNetworkCache = props.skipNetworkCache;
5456
}
5557

5658
async fetch(): Promise<Notice[]> {
57-
// Check connectivity before attempting network request
58-
const hasConnectivity = await NetworkDetector.hasConnectivity(this.agent);
59-
if (!hasConnectivity) {
60-
throw new ToolkitError('No internet connectivity detected');
59+
if (!this.skipNetworkCache) {
60+
// Check connectivity before attempting network request
61+
const hasConnectivity = await NetworkDetector.hasConnectivity(this.agent);
62+
if (!hasConnectivity) {
63+
throw new ToolkitError('No internet connectivity detected');
64+
}
6165
}
6266

6367
// We are observing lots of timeouts when running in a massively parallel

0 commit comments

Comments
 (0)