Skip to content

Commit

Permalink
Handle InvalidRequestError
Browse files Browse the repository at this point in the history
On the same worker,
if the transaction is already started for the session
we should treat it as if the scan has already being submitted.
  • Loading branch information
majamassarini committed Nov 12, 2024
1 parent f04011d commit 6696b09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packit_service/worker/helpers/open_scan_hub.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
from pathlib import Path
from typing import Optional

from sqlalchemy.exc import IntegrityError, InvalidRequestError

from packit.config import (
JobConfig,
JobConfigTriggerType,
JobType,
)
from packit.exceptions import PackitException
from sqlalchemy.exc import IntegrityError

from packit_service.constants import (
OPEN_SCAN_HUB_FEATURE_DESCRIPTION,
)
Expand Down Expand Up @@ -133,7 +133,7 @@ def handle_scan(self):
),
url=url,
)
except IntegrityError as ex:
except (IntegrityError, InvalidRequestError) as ex:
logger.info(f"OpenScanHub already submitted: {ex}")
except OSHNoFeedback as ex:
logger.info(f"OpenScanHub feedback missing: {ex}")
Expand Down

0 comments on commit 6696b09

Please sign in to comment.