File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,10 @@ export class AdminService implements OnApplicationBootstrap {
20
20
) { }
21
21
22
22
async onApplicationBootstrap ( ) : Promise < void > {
23
+ if ( ! this . config . dbRootObjectsSync ) {
24
+ return ;
25
+ }
26
+
23
27
const finishing = this . repo . finishing ( ( ) => this . setupRootObjects ( ) ) ;
24
28
// Wait for root object setup when running tests, else just let it run in
25
29
// the background and allow webserver to start.
Original file line number Diff line number Diff line change @@ -176,16 +176,22 @@ export const makeConfig = (env: EnvironmentService) =>
176
176
: database ,
177
177
ephemeral : this . jest ,
178
178
driverConfig,
179
+ isLocal : parsed . hostname === 'localhost' ,
179
180
} ;
180
181
} ) ( ) ;
181
182
182
183
// Control which database is prioritized, while we migrate.
183
184
databaseEngine = env . string ( 'DATABASE' ) . optional ( 'neo4j' ) . toLowerCase ( ) ;
184
185
185
- dbIndexesCreate = env . boolean ( 'DB_CREATE_INDEXES' ) . optional ( true ) ;
186
+ dbIndexesCreate = env
187
+ . boolean ( 'DB_CREATE_INDEXES' )
188
+ . optional ( isDev ? this . neo4j . isLocal : true ) ;
186
189
dbAutoMigrate = env
187
190
. boolean ( 'DB_AUTO_MIGRATE' )
188
- . optional ( process . env . NODE_ENV !== 'production' && ! this . jest ) ;
191
+ . optional ( isDev && this . neo4j . isLocal && ! this . jest ) ;
192
+ dbRootObjectsSync = env
193
+ . boolean ( 'DB_ROOT_OBJECTS_SYNC' )
194
+ . optional ( isDev ? this . neo4j . isLocal : true ) ;
189
195
190
196
files = ( ( ) => {
191
197
const legacyBucket = env . string ( 'FILES_S3_BUCKET' ) . optional ( ) ;
You can’t perform that action at this time.
0 commit comments