File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed
backend/deepchecks_monitoring/bgtasks Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,6 @@ async def run_organization(self, organization):
138138 # Aggregate the monitors per model in order to query the versions windows data only once per model
139139 monitors_per_model = defaultdict (list )
140140 for monitor in list_monitor_scalars :
141- session .expunge (monitor )
142141 monitors_per_model [monitor .check .model ].append (monitor )
143142
144143 for model , monitors in monitors_per_model .items ():
@@ -162,6 +161,7 @@ async def run_organization(self, organization):
162161 # For each monitor enqueue schedules
163162 for monitor in monitors :
164163 schedules = []
164+ session .add (monitor )
165165 frequency = monitor .frequency .to_pendulum_duration ()
166166 schedule_time = monitor .next_schedule
167167
@@ -177,7 +177,6 @@ async def run_organization(self, organization):
177177 try :
178178 await enqueue_tasks (monitor , schedules , organization , session )
179179 monitor .latest_schedule = schedules [- 1 ]
180- session .add (monitor )
181180 await session .commit ()
182181 # NOTE:
183182 # We use 'Repeatable Read Isolation Level' to run query therefore transaction serialization
You can’t perform that action at this time.
0 commit comments