Add sync engine and wire it into the web app

- Add sync_engine.py: background asyncio loop syncing Evotor products to VK market
- Wire sync_loop into lifespan alongside health_check_loop
- Add SYNC_INTERVAL_SECONDS and VK_DEFAULT_PHOTO_PATH settings to config
- Mount default product image in docker-compose
- Add synced_at column to CachedProduct model + migration
- Show synced_at status in catalog products template
- Fix VK groups API response parsing (handle list vs dict)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mguschin
2026-03-10 17:05:37 +03:00
parent 9a68c083e3
commit 1bf82adbfc
8 changed files with 540 additions and 7 deletions

View File

@@ -40,6 +40,7 @@
<th>Кол-во</th>
<th>Ед. изм.</th>
<th>В продаже</th>
<th>Синхронизирован</th>
<th>Фильтр</th>
<th></th>
</tr>
@@ -62,6 +63,15 @@
<i class="bi bi-x-circle-fill text-danger"></i>
{% endif %}
</td>
<td>
{% if product.synced_at %}
<span title="{{ product.synced_at.strftime('%d.%m.%Y %H:%M') }}">
<i class="bi bi-check-circle-fill text-success"></i>
</span>
{% else %}
<span class="text-muted"></span>
{% endif %}
</td>
<td>
{% if mode == "include" %}
<span class="badge bg-success">✓ Включено</span>