@@ -544,23 +544,23 @@ def main():
544
544
545
545
sync_enabled = True
546
546
if use_projects :
547
+ mirror_config = os .path .join (OPENGROK_CONFIG_DIR , "mirror.yml" )
548
+ if not os .path .exists (mirror_config ):
549
+ with open (mirror_config , 'w' ) as fp :
550
+ fp .write ("# Empty config file for opengrok-mirror\n " )
551
+
547
552
num_workers = get_num_from_env (logger , 'WORKERS' ,
548
553
multiprocessing .cpu_count ())
549
554
logger .info ('Number of sync workers: {}' .format (num_workers ))
550
555
551
556
if not os .environ .get (NOMIRROR_ENV_NAME ):
552
- mirror_config = os .path .join (OPENGROK_CONFIG_DIR , "mirror.yml" )
553
- if not os .path .exists (mirror_config ):
554
- with open (mirror_config , 'w' ) as fp :
555
- fp .write ("# Empty config file for opengrok-mirror\n " )
556
- else :
557
- conf = read_config (logger , mirror_config )
558
- logger .info ("Checking mirror configuration in '{}'" .
559
- format (mirror_config ))
560
- if not check_configuration (conf ):
561
- logger .error ("Mirror configuration in '{}' is invalid, "
562
- "disabling sync" .format (mirror_config ))
563
- sync_enabled = False
557
+ conf = read_config (logger , mirror_config )
558
+ logger .info ("Checking mirror configuration in '{}'" .
559
+ format (mirror_config ))
560
+ if not check_configuration (conf ):
561
+ logger .error ("Mirror configuration in '{}' is invalid, "
562
+ "disabling sync" .format (mirror_config ))
563
+ sync_enabled = False
564
564
565
565
worker_function = project_syncer
566
566
syncer_args = (logger , log_level , uri ,
0 commit comments