Skip to content

Commit cdcd532

Browse files
try this
1 parent 2f46280 commit cdcd532

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pioreactor/utils/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ def _create_tables(self) -> None:
664664
value BLOB,
665665
proposed_value BLOB,
666666
job_id INTEGER NOT NULL,
667-
FOREIGN KEY(job_id) REFERENCES pio_job_metadata(job_id) ON DELETE CASCADE,
667+
FOREIGN KEY(job_id) REFERENCES pio_job_metadata(job_id),
668668
UNIQUE(setting, job_id)
669669
);
670670
@@ -844,6 +844,9 @@ def kill_jobs(self, all_jobs: bool = False, **query) -> int:
844844

845845
return count
846846

847+
def close(self):
848+
self.conn.close()
849+
847850
def _empty(self):
848851
self.cursor.execute("DELETE FROM pio_job_published_settings")
849852
self.cursor.execute("DELETE FROM pio_job_metadata")
@@ -852,7 +855,8 @@ def __enter__(self) -> JobManager:
852855
return self
853856

854857
def __exit__(self, exc_type, exc_val, tb) -> None:
855-
self.conn.close()
858+
self.close()
859+
return
856860

857861

858862
class ClusterJobManager:

0 commit comments

Comments
 (0)