[update] Increase buffer sizes in Client and Server classes for improved WebSocket performance. Add logging for PDF upload processes in CheckUpPage and ServerHandler. Update binary files for barcodes and QR codes.

This commit is contained in:
Lê Thành Đạt committed 2025-08-04 19:48:04 +07:00
1 parent 1516ed4f8c
commit 3eacc994cf
8 files changed
+6 -5

No files matched your search

Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -177,7 +177,7 @@ public class Client {
protected void initChannel(SocketChannel ch) {
ch.pipeline()
.addLast(new HttpClientCodec())
.addLast(new HttpObjectAggregator(10 * 1024 * 1024))
.addLast(new HttpObjectAggregator(50 * 1024 * 1024))
.addLast(
new WebSocketClientProtocolHandler(
finalUri,
@@ -185,7 +185,7 @@ public class Client {
null,
true,
new DefaultHttpHeaders(),
10 * 1024 * 1024))
50 * 1024 * 1024))
.addLast("ws", ClientHandler.INSTANCE);
}
});
@@ -3672,7 +3672,7 @@ public class CheckUpPage extends JPanel {
* @param pdfType The type of PDF ("ultrasound_result" or "medserinvoice")
*/
private void uploadPdfToBackend(UltrasoundResult ultrasoundResult, String pdfType, String checkupId) {
log.info("uploadPdfToBackend");
// Run PDF export and upload in background thread to avoid blocking UI
CompletableFuture.runAsync(() -> {
try {
+2 -2
View File
@@ -297,8 +297,8 @@ public class Server {
ch.pipeline()
.addLast(new HttpServerCodec())
.addLast(new ChunkedWriteHandler())
.addLast(new HttpObjectAggregator(10 * 1024 * 1024))
.addLast(new WebSocketServerProtocolHandler("/", null, true, 10 * 1024 * 1024))
.addLast(new HttpObjectAggregator(50 * 1024 * 1024))
.addLast(new WebSocketServerProtocolHandler("/", null, true, 50 * 1024 * 1024))
.addLast(new ServerHandler());
}
});
@@ -2200,6 +2200,7 @@ public class ServerHandler extends SimpleChannelInboundHandler<TextWebSocketFram
*/
private void uploadCheckupImageToGoogleDriveAsync(String checkupId, String fileName, byte[] imageData) {
// CẢI TIẾN: Sử dụng CompletableFuture để xử lý bất đồng bộ, hiệu quả hơn new Thread().
log.info("uploadCheckupImageToGoogleDriveAsync");
CompletableFuture.runAsync(() -> {
try {
if (!Server.isGoogleDriveConnected()) {
Binary file not shown.

Before

Width:  |  Height:  |  Size: 103 B

After

Width:  |  Height:  |  Size: 103 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 B

After

Width:  |  Height:  |  Size: 519 B