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

fix: move webhook logs to send_sync #608

Merged
merged 1 commit into from
Jan 28, 2025
Merged
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
13 changes: 3 additions & 10 deletions marketplace/wpp_products/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,6 @@
)
return

close_old_connections()
# Webhook Log
WebhookLog.objects.create(sku_id=sku_id, data=webhook, vtex_app=vtex_app)

except Exception as e:
logger.error(
f"An error occurred during the updating Webhook vtex products for app {app_uuid}, {str(e)}"
Expand Down Expand Up @@ -380,6 +376,9 @@
# Check if the app uses specific queue
celery_queue = app.config.get("celery_queue_name", "product_synchronization")

# Webhook Log
WebhookLog.objects.create(sku_id=sku_id, data=webhook, vtex_app=app)

Check warning on line 380 in marketplace/wpp_products/tasks.py

View check run for this annotation

Codecov / codecov/patch

marketplace/wpp_products/tasks.py#L380

Added line #L380 was not covered by tests

if use_sync_v2:
logger.info(f"App {app_uuid} uses Sync v2. Enqueuing for batch update.")

Expand Down Expand Up @@ -563,12 +562,6 @@
)
return

# Log webhook after successful processing
close_old_connections()
WebhookLog.objects.create(
sku_id=sku_id, data={"IdSku": sku_id, "An": seller}, vtex_app=vtex_app
)

except Exception as e:
logger.error(
f"An error occurred during the processing of SKU: {sku_id} for App: {app_uuid}. Error: {e}"
Expand Down
Loading