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

Release #644

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 2 additions & 4 deletions db/python/connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import json
import logging
import os
from threading import Lock

import databases

Expand All @@ -18,8 +17,6 @@
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__name__)

audit_log_lock = Lock()

TABLES_ORDERED_BY_FK_DEPS = [
'project',
'group',
Expand Down Expand Up @@ -62,6 +59,7 @@ def __init__(
self.meta = meta

self._audit_log_id: int | None = None
self._audit_log_lock = asyncio.Lock()

async def audit_log_id(self):
"""Get audit_log ID for write operations, cached per connection"""
Expand All @@ -70,7 +68,7 @@ async def audit_log_id(self):
'Trying to get a audit_log ID, but not a write connection'
)

with audit_log_lock:
async with self._audit_log_lock:
if not self._audit_log_id:
# pylint: disable=import-outside-toplevel
# make this import here, otherwise we'd have a circular import
Expand Down
4 changes: 2 additions & 2 deletions models/models/analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,10 @@ def to_external(self):
class Analysis(BaseModel):
"""Model for Analysis"""

id: int | None
type: str
status: AnalysisStatus
output: str = None
id: int | None = None
output: str | None = None
sequencing_group_ids: list[str] = []
author: str | None = None
timestamp_completed: str | None = None
Expand Down
Loading