1
0
forked from erp-dev/erp

added image_name to PlateOrder model

This commit is contained in:
2025-11-27 15:14:34 +08:00
parent a9c75a13fa
commit 0fa153849c
12 changed files with 108 additions and 432 deletions

View File

@@ -151,15 +151,16 @@ def shutdown_sse(request):
if not merchant_id:
return Response({'error': 'User has no associated merchant'}, status=status.HTTP_403_FORBIDDEN)
services.push_sse_event_to_merchant(merchant_id, {
'type': 'server_shutdown',
'message': 'Server shutting down your connections, please reconnect later'
})
# 获取连接数
merchant_connections = services.get_merchant_connections(merchant_id)
client_count = len(merchant_connections)
# 实际关闭连接
services.shutdown_merchant_connections(merchant_id)
return Response({
'status': 'ok',
'message': 'Shutdown signal sent to your merchant\'s SSE connections',
'message': 'Your merchant\'s SSE connections have been closed',
'merchant_id': merchant_id,
'clients': len(merchant_connections)
'clients': client_count
})