File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export class ConfigService {
20
20
public static readonly OPENSUBTITLES_PASSWORD : string = 'OPENSUBTITLES_PASSWORD'
21
21
public static readonly SUBTITLES_LANGUAGES : string = 'SUBTITLES_LANGUAGES'
22
22
public static readonly MAX_CONCURRENT_DOWNLOADS : string = 'MAX_CONCURRENT_DOWNLOADS'
23
+ public static readonly MAX_CONNS : string = 'MAX_CONNS'
23
24
public static readonly TRAKT_KEY : string = 'TRAKT_KEY'
24
25
25
26
private readonly envConfig : { [ key : string ] : string }
@@ -111,6 +112,9 @@ export class ConfigService {
111
112
112
113
[ ConfigService . MAX_CONCURRENT_DOWNLOADS ] : Joi . number ( )
113
114
. default ( 1 ) ,
115
+
116
+ [ ConfigService . MAX_CONNS ] : Joi . number ( )
117
+ . default ( 35 ) ,
114
118
} )
115
119
116
120
const { error, value : validatedEnvConfig } = envVarsSchema . validate ( envConfig , { stripUnknown : true } )
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ export class TorrentService implements OnApplicationBootstrap {
33
33
*/
34
34
private readonly maxConcurrent
35
35
36
+ /**
37
+ * Maximum of concurrent connections
38
+ */
39
+ private readonly maxConns
40
+
36
41
/**
37
42
* All the different supported formats
38
43
*/
@@ -93,6 +98,7 @@ export class TorrentService implements OnApplicationBootstrap {
93
98
private readonly episodesService : EpisodesService
94
99
) {
95
100
this . maxConcurrent = this . configService . get ( ConfigService . MAX_CONCURRENT_DOWNLOADS )
101
+ this . maxConns = this . configService . get ( ConfigService . MAX_CONNS )
96
102
}
97
103
98
104
/**
@@ -117,7 +123,7 @@ export class TorrentService implements OnApplicationBootstrap {
117
123
this . logger . log ( 'Creating new WebTorrent client' )
118
124
119
125
this . webTorrent = new WebTorrent ( {
120
- maxConns : 35
126
+ maxConns : this . maxConns
121
127
} )
122
128
123
129
this . webTorrent . on ( 'error' , ( err ) => {
You can’t perform that action at this time.
0 commit comments