File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,9 @@ export class ProxiedApp {
54
54
let options ;
55
55
56
56
// Pre events need to be fast as they block the user
57
- if ( method . startsWith ( 'checkPre' ) || method . startsWith ( 'executePre' ) ) {
58
- options = { timeout : 1000 } ;
59
- }
57
+ // if (method.startsWith('checkPre') || method.startsWith('executePre')) {
58
+ // options = { timeout: 1000 };
59
+ // }
60
60
61
61
try {
62
62
return await this . appRuntime . sendRequest ( { method : `app:${ method } ` , params : args } , options ) ;
Original file line number Diff line number Diff line change @@ -53,6 +53,18 @@ const COMMAND_PONG = '_zPONG';
53
53
54
54
export const JSONRPC_METHOD_NOT_FOUND = - 32601 ;
55
55
56
+ export function getRuntimeTimeout ( ) {
57
+ const defaultTimeout = 30000 ;
58
+ const envValue = isFinite ( process . env . APPS_ENGINE_RUNTIME_TIMEOUT as any ) ? Number ( process . env . APPS_ENGINE_RUNTIME_TIMEOUT ) : defaultTimeout ;
59
+
60
+ if ( envValue < 0 ) {
61
+ console . log ( 'Environment variable APPS_ENGINE_RUNTIME_TIMEOUT has a negative value, ignoring...' ) ;
62
+ return defaultTimeout ;
63
+ }
64
+
65
+ return envValue ;
66
+ }
67
+
56
68
export function isValidOrigin ( accessor : string ) : accessor is typeof ALLOWED_ACCESSOR_METHODS [ number ] {
57
69
return ALLOWED_ACCESSOR_METHODS . includes ( accessor as any ) ;
58
70
}
@@ -88,7 +100,7 @@ export class DenoRuntimeSubprocessController extends EventEmitter {
88
100
private readonly debug : debug . Debugger ;
89
101
90
102
private readonly options = {
91
- timeout : 10000 ,
103
+ timeout : getRuntimeTimeout ( ) ,
92
104
} ;
93
105
94
106
private readonly accessors : AppAccessorManager ;
You can’t perform that action at this time.
0 commit comments