Skip to content

Instantly share code, notes, and snippets.

@johnnyji
Created July 28, 2022 20:21
Show Gist options
  • Save johnnyji/433d8a59a50c148467e06499c2b13c4f to your computer and use it in GitHub Desktop.
Save johnnyji/433d8a59a50c148467e06499c2b13c4f to your computer and use it in GitHub Desktop.

Company had LL order not created in Distru

SELECT leaflink_order_cache_updated_up_until FROM companies WHERE id = 298490;

This tells me that the company's last updated time for the LL order sync was July 28th

SELECT leaflink_id, jsonb_pretty(payload) FROM leaflink_order_caches loc WHERE loc.payload ->>'short_id'='8a5cca4213a' AND archived_at IS NULL;

Getting the payload tells me that the order was created on July 25th and the LL order's LL ID is 2812611e-29f0-4a24-ab3a-f497dda65bc2.

Now we need to SSH into production pod in order to perform Distru.Workers.Leaflink.UpsertDistruSalesOrder manually:

company = Distru.Repo.get!(Distru.Company, 298490)
Distru.Workers.Leaflink.UpsertDistruSalesOrder.perform(%Oban.Job{args: %{"company_id" => 298490, "leaflink_order_id" => "2812611e-29f0-4a24-ab3a-f497dda65bc2"}})

Running this showed me via logs that our OR solver failed to assign locations to all line items. However, upon running this a second time, it seemed like the SO was created. I impersonated the customer to check and the SO was indeed there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment