优化SSH线程池
This commit is contained in:
parent
81a11c4594
commit
78c2ef0dd9
18
backend/replace_timestamps.py
Normal file
18
backend/replace_timestamps.py
Normal file
@ -0,0 +1,18 @@
|
||||
import re
|
||||
|
||||
# 读取文件
|
||||
file_path = r'd:\work\java-space\deploy-ease-platform\backend\src\main\resources\db\changelog\changes\v1.0.0-data.sql'
|
||||
|
||||
with open(file_path, 'r', encoding='utf-8') as f:
|
||||
content = f.read()
|
||||
|
||||
# 替换时间戳为 NOW()
|
||||
# 匹配格式: 'YYYY-MM-DD HH:MM:SS' 或 'YYYY-MM-DD HH:MM:SS.ffffff'
|
||||
pattern = r"'[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?'"
|
||||
new_content = re.sub(pattern, 'NOW()', content)
|
||||
|
||||
# 写回文件
|
||||
with open(file_path, 'w', encoding='utf-8') as f:
|
||||
f.write(new_content)
|
||||
|
||||
print("替换完成!")
|
||||
@ -759,7 +759,7 @@ INSERT INTO `deploy-ease-platform`.`sys_notification_channel` (`id`, `create_by`
|
||||
INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (8, 'admin', NOW(), 'dengqichen', NOW(), 36, b'0', 'JENKINS构建状态通知', 'jenkins_build_notification', '', 'WEWORK', '## <#if environmentName??>${environmentName}</#if>环境构建通知', '>项目:<#if applicationName??><font>${applicationName}(${applicationCode})</font></#if>\r\n<#if buildStatus??>\r\n<#switch buildStatus>\r\n<#case \"SUCCESS\">\r\n>状态:<font color=\"info\">构建成功</font>\r\n<#break>\r\n<#case \"BUILDING\">\r\n>状态:<font color=\"comment\">构建中</font>\r\n<#break>\r\n<#case \"ABORTED\">\r\n>状态:<font color=\"warning\">构建被取消</font>\r\n<#break>\r\n<#default>\r\n>状态:<font color=\"warning\">构建失败</font>\r\n</#switch>\r\n</#if>\r\n<#if buildStatus?? && buildStatus != \"BUILDING\">\r\n<#if buildDurationFormatted??>\r\n>耗时:${buildDurationFormatted}\r\n</#if>\r\n<#if buildEndTime??>\r\n>时间:${buildEndTime}\r\n</#if>\r\n<#else>\r\n<#if buildStartTime??>\r\n>时间:${buildStartTime}\r\n</#if>\r\n</#if>\r\n<#if commitMessage??>\r\n>内容:\r\n<#list commitMessage?split(\'\\n\') as line>\r\n>${line}\r\n</#list>\r\n</#if>', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');
|
||||
INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (9, 'admin', NOW(), 'admin', NOW(), 10, b'0', '国产化构建通知', 'localization_build_notification', '国产化模版', 'WEWORK', '## <#if environmentName??>${environmentName}</#if>环境变更通知', '>项目:<#if applicationName??><font>${applicationName}(${applicationCode})</font></#if>\r\n<#-- 通过判断HTTP节点输出是否存在来区分阶段 -->\r\n<#if sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf?? && sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf.outputs??>\r\n<#-- ========== 构建结束阶段(HTTP节点已执行)========== -->\r\n<#assign httpOutput = sid_d7bd35dc_37cc_4868_9c8a_9c854d5d6bbf.outputs>\r\n<#if httpOutput.isSuccess!false>\r\n<#if httpOutput.responseBody?? && httpOutput.responseBody.status?? && httpOutput.responseBody.status == \"success\">\r\n>状态:<font color=\"info\">构建成功</font>\r\n<#if httpOutput.responseBody.duration??>\r\n>耗时:${httpOutput.responseBody.duration}秒\r\n</#if>\r\n<#if httpOutput.responseBody.endTime??>\r\n>时间:${httpOutput.responseBody.endTime}\r\n</#if>\r\n<#else>\r\n>状态:<font color=\"warning\">构建失败</font>\r\n<#if httpOutput.responseBody?? && httpOutput.responseBody.error??>\r\n>错误:${httpOutput.responseBody.error}\r\n</#if>\r\n</#if>\r\n<#else>\r\n>状态:<font color=\"warning\">构建失败</font>\r\n<#if httpOutput.statusCode?? && httpOutput.statusCode gt 0>\r\n>HTTP状态码:${httpOutput.statusCode}\r\n<#else>\r\n>错误类型:网络连接异常\r\n</#if>\r\n<#if httpOutput.errorMessage??>\r\n>错误详情:${httpOutput.errorMessage}\r\n</#if>\r\n<#if httpOutput.responseTime??>\r\n>请求耗时:${httpOutput.responseTime}ms\r\n</#if>\r\n</#if>\r\n<#else>\r\n<#-- ========== 构建中阶段(HTTP节点未执行)========== -->\r\n>状态:<font color=\"comment\">构建中</font>\r\n<#if deployDate??>\r\n<#attempt>\r\n<#assign deployDateTime = deployDate?datetime.iso>\r\n>时间:${deployDateTime?string(\"yyyy-MM-dd HH:mm:ss\")}\r\n<#recover>\r\n>时间:${deployDate}\r\n</#attempt>\r\n</#if>\r\n</#if>\r\n>内容:<#if deployRemark??><font>${deployRemark}</font><#else>无构建内容</#if>\r\n', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');
|
||||
INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (10, 'admin', NOW(), 'admin', NOW(), 3, b'0', 'Git同步检测通知', 'git_sync_code_check_notification', '', 'WEWORK', '## 代码同步检查异常', '${sid_e5f930da_062e_4819_b976_8d8172c7f14a.outputs.checkDetail}', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');
|
||||
INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (11, 'admin', NOW(), 'dengqichen', NOW(), 3, b'0', '服务器阈值预警通知', 'server_threshold_warning_notification', '', 'WEWORK', '## 服务器${alertLevel}告警通知', '> 服务器名称:${serverName}\r\n> 服务器IP:${serverIp}\r\n\r\n> 告警规则:${ruleName}-${alertType}-${resourceInfo}\r\n\r\n> 当前值:<font color=\"warning\">${currentValue}%</font>,阈值:${threshold}%\r\n> 告警时间:${alertTime}\r\n\r\n请及时处理告警信息!', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');
|
||||
INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (11, 'admin', NOW(), 'dengqichen', NOW(), 4, b'0', '服务器阈值预警通知', 'server_threshold_warning_notification', '', 'WEWORK', '## 服务器${alertLevel}${resourceInfo}告警通知', '> 服务器名称:${serverName}\r\n\r\n> 告警规则:${ruleName}-${alertType}\r\n\r\n> 当前值:<font color=\"warning\">${currentValue}%</font>,阈值:${threshold}%\r\n> 告警时间:${alertTime}\r\n\r\n请及时处理告警信息!', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');
|
||||
INSERT INTO `deploy-ease-platform`.`sys_notification_template` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `name`, `code`, `description`, `channel_type`, `title_template`, `content_template`, `enabled`, `template_config`) VALUES (12, 'admin', NOW(), 'dengqichen', NOW(), 2, b'0', '服务器离线预警', 'server_offline_warning_notification', '', 'WEWORK', '## 服务器离线通知', '> 服务器名称:${serverName}\r\n\r\n**离线详情**\r\n> 检测时间:${offlineTime}\r\n> 状态:<font color=\"warning\">服务器无法访问</font>\r\n\r\n请立即处理服务器离线问题!', b'1', '{\"channelType\": \"WEWORK\", \"messageType\": \"MARKDOWN\"}');
|
||||
|
||||
INSERT INTO `deploy-ease-platform`.`schedule_job_category` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `version`, `deleted`, `code`, `name`, `description`, `icon`, `color`, `enabled`, `sort`) VALUES (1, 'system', NOW(), 'system', NOW(), 1, b'0', 'DATA_CLEAN', '数据清理', '定期清理系统历史数据和临时文件', 'DeleteOutlined', '#ff4d4f', b'1', 1);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user