Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mon-greenlet_spawn-has-not-been-called-v3 #379

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions backend/deepchecks_monitoring/bgtasks/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ async def run_organization(self, organization):
# Aggregate the monitors per model in order to query the versions windows data only once per model
monitors_per_model = defaultdict(list)
for monitor in list_monitor_scalars:
session.expunge(monitor)
monitors_per_model[monitor.check.model].append(monitor)

for model, monitors in monitors_per_model.items():
Expand All @@ -162,6 +161,7 @@ async def run_organization(self, organization):
# For each monitor enqueue schedules
for monitor in monitors:
schedules = []
session.add(monitor)
frequency = monitor.frequency.to_pendulum_duration()
schedule_time = monitor.next_schedule

Expand All @@ -177,7 +177,6 @@ async def run_organization(self, organization):
try:
await enqueue_tasks(monitor, schedules, organization, session)
monitor.latest_schedule = schedules[-1]
session.add(monitor)
await session.commit()
# NOTE:
# We use 'Repeatable Read Isolation Level' to run query therefore transaction serialization
Expand Down
Loading