@@ -1105,16 +1105,18 @@ def _run_scheduler_loop(self) -> None:
1105
1105
)
1106
1106
1107
1107
for loop_count in itertools .count (start = 1 ):
1108
- with Trace .start_span (span_name = "scheduler_job_loop" , component = "SchedulerJobRunner" ) as span :
1108
+ with Trace .start_span (
1109
+ span_name = "scheduler_job_loop" , component = "SchedulerJobRunner"
1110
+ ) as span , Stats .timer ("scheduler.scheduler_loop_duration" ) as timer :
1109
1111
span .set_attribute ("category" , "scheduler" )
1110
1112
span .set_attribute ("loop_count" , loop_count )
1111
- with Stats . timer ( "scheduler.scheduler_loop_duration" ) as timer :
1112
- if self .using_sqlite and self .processor_agent :
1113
- self .processor_agent .run_single_parsing_loop ()
1114
- # For the sqlite case w/ 1 thread, wait until the processor
1115
- # is finished to avoid concurrent access to the DB.
1116
- self .log .debug ("Waiting for processors to finish since we're using sqlite" )
1117
- self .processor_agent .wait_until_finished ()
1113
+
1114
+ if self .using_sqlite and self .processor_agent :
1115
+ self .processor_agent .run_single_parsing_loop ()
1116
+ # For the sqlite case w/ 1 thread, wait until the processor
1117
+ # is finished to avoid concurrent access to the DB.
1118
+ self .log .debug ("Waiting for processors to finish since we're using sqlite" )
1119
+ self .processor_agent .wait_until_finished ()
1118
1120
1119
1121
with create_session () as session :
1120
1122
# This will schedule for as many executors as possible.
0 commit comments