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

Added RetryException handler and bumped the sdk versions #73

Merged
merged 2 commits into from
Feb 15, 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
19 changes: 18 additions & 1 deletion apps/fyle/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand Down Expand Up @@ -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 = {
Expand Down
1 change: 0 additions & 1 deletion apps/mappings/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading