File tree Expand file tree Collapse file tree 3 files changed +16
-18
lines changed Expand file tree Collapse file tree 3 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -6,11 +6,11 @@ import { UploadOptions } from '@actions/cache/lib/options'
6
6
7
7
import {
8
8
ObjectStoreOptions ,
9
- getClient ,
10
- getBucket ,
11
- checkPaths ,
9
+ ValidationError ,
12
10
checkKey ,
13
- ValidationError
11
+ checkPaths ,
12
+ getBucket ,
13
+ getClient ,
14
14
} from './utils'
15
15
16
16
/**
Original file line number Diff line number Diff line change 1
1
import { CompressionMethod } from '@actions/cache/lib/internal/constants'
2
2
import * as utils from '@actions/cache/lib/internal/cacheUtils'
3
3
import * as minio from 'minio'
4
+ import * as http from 'http'
5
+ import * as https from 'https'
4
6
import yn from 'yn'
5
7
6
8
export interface ObjectStoreOptions {
@@ -86,6 +88,14 @@ export async function listObjects(
86
88
}
87
89
88
90
export function getClient ( options : ObjectStoreOptions ) : minio . Client {
91
+ let useSSL = options . useSSL ?? yn ( process . env [ 'ALT_GHA_CACHE_USE_SSL' ] ) ?? true
92
+ let httpsTransportAgent = new https . Agent ( {
93
+ timeout : 120000 ,
94
+ } )
95
+ let httpTransportAgent = new http . Agent ( {
96
+ timeout : 120000 ,
97
+ } )
98
+ let transportAgent = useSSL ? httpsTransportAgent : httpTransportAgent
89
99
return new minio . Client ( {
90
100
endPoint :
91
101
options . endPoint ??
@@ -112,7 +122,8 @@ export function getClient(options: ObjectStoreOptions): minio.Client {
112
122
process . env [ 'ALT_GHA_CACHE_REGION' ] ??
113
123
process . env [ 'AWS_REGION' ] ??
114
124
'' ,
115
- useSSL : options . useSSL ?? yn ( process . env [ 'ALT_GHA_CACHE_USE_SSL' ] ) ?? true
125
+ useSSL : useSSL ,
126
+ transportAgent : transportAgent
116
127
} )
117
128
}
118
129
You can’t perform that action at this time.
0 commit comments