forked from erp-dev/erp
added image_name to PlateOrder model
This commit is contained in:
15
sse/views.py
15
sse/views.py
@@ -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
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user