Commit 4adf1a63 by xushaohua

feat:部署

parent fa58bf39
...@@ -52,7 +52,7 @@ public class NotifyServiceImpl implements NotifyService { ...@@ -52,7 +52,7 @@ public class NotifyServiceImpl implements NotifyService {
try { try {
ResponseEntity<String> responseEntity = postJson(notifyHook, paramsStr); ResponseEntity<String> responseEntity = postJson(notifyHook, paramsStr);
if (responseEntity.getStatusCode() == HttpStatus.OK) { if (responseEntity.getStatusCode() == HttpStatus.OK) {
log.debug("推送任务变更成功, 任务ID: {}, status: {}, notifyHook: {}", taskId, taskStatus, notifyHook); log.info("推送任务变更成功, 任务ID: {}, status: {}, notifyHook: {}", taskId, taskStatus, notifyHook);
} else { } else {
log.warn("推送任务变更失败, 任务ID: {}, notifyHook: {}, code: {}, msg: {}", taskId, notifyHook, responseEntity.getStatusCodeValue(), responseEntity.getBody()); log.warn("推送任务变更失败, 任务ID: {}, notifyHook: {}, code: {}, msg: {}", taskId, notifyHook, responseEntity.getStatusCodeValue(), responseEntity.getBody());
} }
......
...@@ -121,7 +121,7 @@ public class TaskQueueHelper { ...@@ -121,7 +121,7 @@ public class TaskQueueHelper {
task.sleep(); task.sleep();
changeStatusAndNotify(task, task.getStatus()); changeStatusAndNotify(task, task.getStatus());
} while (task.getStatus() == TaskStatus.IN_PROGRESS); } while (task.getStatus() == TaskStatus.IN_PROGRESS);
log.debug("task finished, id: {}, status: {}", task.getId(), task.getStatus()); log.info("task finished, id: {}, status: {}", task.getId(), task.getStatus());
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} catch (Exception e) { } catch (Exception e) {
......
...@@ -30,7 +30,7 @@ public class TaskTimeoutSchedule { ...@@ -30,7 +30,7 @@ public class TaskTimeoutSchedule {
if (Set.of(TaskStatus.FAILURE, TaskStatus.SUCCESS).contains(task.getStatus())) { if (Set.of(TaskStatus.FAILURE, TaskStatus.SUCCESS).contains(task.getStatus())) {
log.warn("task status is failure/success but is in the queue, end it. id: {}", task.getId()); log.warn("task status is failure/success but is in the queue, end it. id: {}", task.getId());
} else { } else {
log.debug("task timeout, id: {}", task.getId()); log.info("task timeout, id: {}", task.getId());
task.fail("任务超时"); task.fail("任务超时");
} }
Future<?> future = this.taskQueueHelper.getRunningFuture(task.getId()); Future<?> future = this.taskQueueHelper.getRunningFuture(task.getId());
......
...@@ -58,7 +58,7 @@ public class BotMessageListener extends ListenerAdapter implements ApplicationLi ...@@ -58,7 +58,7 @@ public class BotMessageListener extends ListenerAdapter implements ApplicationLi
if (CharSequenceUtil.isBlank(authorName)) { if (CharSequenceUtil.isBlank(authorName)) {
authorName = "System"; authorName = "System";
} }
log.debug("{} - {}: {}", messageType.name(), authorName, message.getContentRaw()); log.info("{} - {}: {}", messageType.name(), authorName, message.getContentRaw());
return false; return false;
} }
......
...@@ -48,7 +48,7 @@ public class UserMessageListener implements ApplicationListener<ApplicationStart ...@@ -48,7 +48,7 @@ public class UserMessageListener implements ApplicationListener<ApplicationStart
return true; return true;
} }
String authorName = data.optObject("author").map(a -> a.getString("username")).orElse("System"); String authorName = data.optObject("author").map(a -> a.getString("username")).orElse("System");
log.debug("{} - {}: {}", messageType.name(), authorName, data.opt("content").orElse("")); log.info("{} - {}: {}", messageType.name(), authorName, data.opt("content").orElse(""));
return false; return false;
} }
} }
\ No newline at end of file
...@@ -66,21 +66,24 @@ public class UserWebSocketStarter extends WebSocketAdapter implements WebSocketS ...@@ -66,21 +66,24 @@ public class UserWebSocketStarter extends WebSocketAdapter implements WebSocketS
*/ */
@Override @Override
public synchronized void start() throws Exception { public synchronized void start() throws Exception {
log.info("socket开始连接");
this.decompressor = new ZlibDecompressor(2048); this.decompressor = new ZlibDecompressor(2048);
this.heartExecutor = Executors.newSingleThreadScheduledExecutor(); this.heartExecutor = Executors.newSingleThreadScheduledExecutor();
WebSocketFactory webSocketFactory = createWebSocketFactory(this.properties); WebSocketFactory webSocketFactory = createWebSocketFactory(this.properties);
this.socket = webSocketFactory.createSocket(this.discordHelper.getWss() + "/?encoding=json&v=9&compress=zlib-stream"); this.socket = webSocketFactory.createSocket(this.discordHelper.getWss() + "/?encoding=json&v=9&compress=zlib-stream");
log.info("socket创建完成:{}", this.discordHelper.getWss() + "/?encoding=json&v=9&compress=zlib-stream");
this.socket.addListener(this); this.socket.addListener(this);
this.socket.addHeader("Accept-Encoding", "gzip, deflate, br").addHeader("Accept-Language", "en-US,en;q=0.9") this.socket.addHeader("Accept-Encoding", "gzip, deflate, br").addHeader("Accept-Language", "en-US,en;q=0.9")
.addHeader("Cache-Control", "no-cache").addHeader("Pragma", "no-cache") .addHeader("Cache-Control", "no-cache").addHeader("Pragma", "no-cache")
.addHeader("Sec-WebSocket-Extensions", "permessage-deflate; client_max_window_bits") .addHeader("Sec-WebSocket-Extensions", "permessage-deflate; client_max_window_bits")
.addHeader("User-Agent", this.userAgent); .addHeader("User-Agent", this.userAgent);
this.socket.connect(); this.socket.connect();
log.info("socket连接上了");
} }
@Override @Override
public void onConnected(WebSocket websocket, Map<String, List<String>> headers) { public void onConnected(WebSocket websocket, Map<String, List<String>> headers) {
log.debug("[gateway]连接上了websocket."); log.info("[gateway]连接上了websocket.");
this.connected = true; this.connected = true;
} }
...@@ -114,10 +117,10 @@ public class UserWebSocketStarter extends WebSocketAdapter implements WebSocketS ...@@ -114,10 +117,10 @@ public class UserWebSocketStarter extends WebSocketAdapter implements WebSocketS
} else if (opCode == WebSocketCode.HEARTBEAT) { } else if (opCode == WebSocketCode.HEARTBEAT) {
send(DataObject.empty().put("op", WebSocketCode.HEARTBEAT).put("d", this.sequence)); send(DataObject.empty().put("op", WebSocketCode.HEARTBEAT).put("d", this.sequence));
} else if (opCode == WebSocketCode.INVALIDATE_SESSION) { } else if (opCode == WebSocketCode.INVALIDATE_SESSION) {
log.debug("[gateway] Invalid session."); log.info("[gateway] Invalid session.");
close("session invalid"); close("session invalid");
} else if (opCode == WebSocketCode.RECONNECT) { } else if (opCode == WebSocketCode.RECONNECT) {
log.debug("[gateway] Received opcode 7 (reconnect)."); log.info("[gateway] Received opcode 7 (reconnect).");
close("reconnect"); close("reconnect");
} else if (opCode == WebSocketCode.DISPATCH) { } else if (opCode == WebSocketCode.DISPATCH) {
onDispatch(data); onDispatch(data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment