Skip to content

Commit a20316a

Browse files
committed
Fix crash in retry job
1 parent 43ec74e commit a20316a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

jbi/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
APP_DIR = Path(__file__).parents[1]
3333

3434
settings = get_settings()
35-
version_info = get_version(APP_DIR)
35+
version_info: dict[str, str] = get_version(APP_DIR)
3636
VERSION: str = version_info["version"]
3737

3838
logging.config.dictConfig(CONFIG)

jbi/queue.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import traceback
2929
from abc import ABC, abstractmethod
3030
from datetime import datetime
31-
from functools import lru_cache
31+
from functools import cached_property, lru_cache
3232
from json import JSONDecodeError
3333
from pathlib import Path
3434
from typing import AsyncIterator, Optional
@@ -37,7 +37,7 @@
3737
import dockerflow.checks
3838
from pydantic import BaseModel, FileUrl, ValidationError, computed_field
3939

40-
from jbi import app, bugzilla
40+
from jbi import bugzilla
4141
from jbi.environment import get_settings
4242

4343
logger = logging.getLogger(__name__)
@@ -90,9 +90,11 @@ class QueueItem(BaseModel, frozen=True):
9090
rid: Optional[str] = None
9191

9292
@computed_field # type: ignore
93-
@property
93+
@cached_property
9494
def version(self) -> str:
9595
# Prevents circular imports.
96+
from jbi import app
97+
9698
return app.VERSION
9799

98100
@property

0 commit comments

Comments
 (0)