MOHAN c2b5168a04 fix: resolve inventory sync crash loop and parallel execution issues
- Remove process.exit(1) that caused PM2 to restart in an infinite loop
- Fix && false bug that forced Turn14 token refresh on every run
- Remove global SHOP/ACCESS_TOKEN to eliminate race conditions
- Make shop loop sequential (for...of + await) to prevent Turn14 429s
- Add early return when Turn14 credentials are missing for a shop
- Guard non-JSON Turn14 responses (429 plain text) before calling .json()
- Ensure logs/ and exports/ dirs exist before writing
- Pass shop/accessToken as params to all helper functions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 00:53:55 +05:30
..