diff --git a/apps/fyle/tasks.py b/apps/fyle/tasks.py index 1f92562..7af86d9 100644 --- a/apps/fyle/tasks.py +++ b/apps/fyle/tasks.py @@ -11,8 +11,9 @@ from django.db import transaction from fyle_integrations_platform_connector import PlatformConnector -from apps.tasks.models import AccountingExport +from fyle.platform.exceptions import RetryException +from apps.tasks.models import AccountingExport from apps.workspaces.models import Workspace, ExportSettings, FyleCredential from .models import Expense @@ -64,6 +65,14 @@ def import_reimbursable_expenses(workspace_id, accounting_export: AccountingExpo accounting_export.status = 'FAILED' accounting_export.save() + except RetryException: + logger.info('Fyle Retry Exception occured in workspace_id %s', workspace_id) + accounting_export.detail = { + 'message': 'Fyle Retry Exception occured' + } + accounting_export.status = 'FATAL' + accounting_export.save() + except Exception: error = traceback.format_exc() accounting_export.detail = { @@ -118,6 +127,14 @@ def import_credit_card_expenses(workspace_id, accounting_export: AccountingExpor accounting_export.status = 'FAILED' accounting_export.save() + except RetryException: + logger.info('Fyle Retry Exception occured in workspace_id %s', workspace_id) + accounting_export.detail = { + 'message': 'Fyle Retry Exception occured' + } + accounting_export.status = 'FATAL' + accounting_export.save() + except Exception: error = traceback.format_exc() accounting_export.errors = { diff --git a/apps/mappings/connector.py b/apps/mappings/connector.py index eb0f195..fc6f3b6 100644 --- a/apps/mappings/connector.py +++ b/apps/mappings/connector.py @@ -22,7 +22,6 @@ def __init__(self, workspace_id: int): self.workspace_id = workspace_id - def sync_corporate_card(self): """ Sync Cards will sync the corporate cards details from fyle to qbd db diff --git a/requirements.txt b/requirements.txt index 8da0849..a1547a0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -24,12 +24,12 @@ gevent==23.9.1 gunicorn==20.1.0 # Platform SDK -fyle==0.34.0 +fyle==0.36.1 # Reusable Fyle Packages fyle-rest-auth==1.6.0 fyle-accounting-mappings==1.26.0 -fyle-integrations-platform-connector==1.35.3 +fyle-integrations-platform-connector==1.36.3 # Postgres Dependincies psycopg2-binary==2.8.4