File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
import "./polyfill" ;
2
2
import { initServer } from "./server" ;
3
+ import { env } from "./utils/env" ;
3
4
import { logger } from "./utils/logger" ;
4
5
import { initWorker } from "./worker" ;
5
6
6
7
const main = async ( ) => {
7
- initServer ( ) ;
8
- initWorker ( ) ;
8
+ if ( env . ENGINE_MODE === "server_only" ) {
9
+ initServer ( ) ;
10
+ } else if ( env . ENGINE_MODE === "worker_only" ) {
11
+ initWorker ( ) ;
12
+ } else {
13
+ initServer ( ) ;
14
+ initWorker ( ) ;
15
+ }
9
16
} ;
10
17
11
18
main ( ) ;
Original file line number Diff line number Diff line change @@ -79,7 +79,9 @@ export const env = createEnv({
79
79
. nonnegative ( )
80
80
. default ( 0 ) ,
81
81
REDIS_URL : z . string ( ) ,
82
- ENGINE_MODE : z . enum ( [ "sandbox" , "unrestricted" ] ) . default ( "unrestricted" ) ,
82
+ ENGINE_MODE : z
83
+ . enum ( [ "default" , "sandbox" , "server_only" , "worker_only" ] )
84
+ . default ( "default" ) ,
83
85
} ,
84
86
clientPrefix : "NEVER_USED" ,
85
87
client : { } ,
You can’t perform that action at this time.
0 commit comments