Skip to content

Commit

Permalink
upate workspace last synced fix (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruuushhh authored Mar 6, 2024
1 parent 386b917 commit 60ccb7e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions apps/fyle/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
from typing import Dict, List

from django.db import transaction
from fyle.platform.exceptions import (
InvalidTokenError as FyleInvalidTokenError,
RetryException,
)
from fyle.platform.exceptions import InvalidTokenError as FyleInvalidTokenError
from fyle.platform.exceptions import RetryException
from fyle_integrations_platform_connector import PlatformConnector

from apps.fyle.actions import create_generator_and_post_in_batches
Expand Down Expand Up @@ -103,7 +101,7 @@ def async_create_expense_groups(
)
)

if expenses:
if workspace.last_synced_at or expenses:
workspace.last_synced_at = datetime.now()
reimbursable_expenses_count += len(expenses)

Expand All @@ -126,7 +124,7 @@ def async_create_expense_groups(
)
)

if len(expenses) != reimbursable_expenses_count:
if workspace.ccc_last_synced_at or len(expenses) != reimbursable_expenses_count:
workspace.ccc_last_synced_at = datetime.now()

workspace.save()
Expand Down

0 comments on commit 60ccb7e

Please sign in to comment.