File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
packages/@aws-cdk/toolkit-lib/lib/api/notices Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments