[*] 日常优化

This commit is contained in:
acgist
2023-06-14 11:59:25 +08:00
parent 1fb00625b0
commit 021b275717
4 changed files with 42 additions and 37 deletions

View File

@@ -20,26 +20,26 @@
## SDP格式 ## SDP格式
``` ```
v= (protocol version) #协议版本 v= (protocol version) # 协议版本
o= (owner/creator and session identifier) #所有者创建者和会话标识符 o= (owner/creator and session identifier) # 所有者/创建者和会话标识符
s= (session name) #会话名称 s= (session name) # 会话名称
i=* (session information) #会话信息 i=* (session information) # 会话信息
u=* (URI of description) #URI描述 u=* (URI of description) # URI描述
e=* (email address) #Email地址 e=* (email address) # Email地址
p=* (phone number) #电话号码 p=* (phone number) # 电话号码
c=* (connection information - not required if included in all media) #连接信息(如果包含在所有媒体中则不需要该字段) c=* (connection information - not required if included in all media) # 连接信息
b=* (zero or more bandwidth information lines) #带宽信息 b=* (zero or more bandwidth information lines) # 零或多个带宽信息
z=* (time zone adjustments) #时区调整 z=* (time zone adjustments) # 时区调整
k=* (encryption key) #加密密钥 k=* (encryption key) # 加密密钥
a=* (zero or more session attribute lines) #0或多次会话属性 a=* (zero or more session attribute lines) #或多次会话属性
Time description #时间描述 Time description # 时间描述
t= (time the session is active) #会话活动时间 t= (time the session is active) # 会话活动时间
r=* (zero or more repeat times) #0或多次重复次数 r=* (zero or more repeat times) #或多次重复次数
Media description #媒体描述 Media description # 媒体描述
m= (media name and transport address) #媒体名称和传输地址 m= (media name and transport address) # 媒体名称和传输地址
i=* (media title) #媒体标题 i=* (media title) # 媒体标题
c=* (connection information - optional if included at session-level) #连接信息(如果包含在会话层则该字段可选) c=* (connection information - optional if included at session-level) # 连接信息
b=* (zero or more bandwidth information lines) #带宽信息 b=* (zero or more bandwidth information lines) # 零或多个带宽信息
k=* (encryption key) #加密密钥 k=* (encryption key) # 加密密钥
a=* (zero or more media attribute lines) #0或多个会话属性 a=* (zero or more media attribute lines) #或多个会话属性
```` ````

View File

@@ -5,7 +5,7 @@
######################### #########################
killIndex=0 killIndex=0
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk "{print $2}") processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
if [ ! -z "$processId" ]; then if [ ! -z "$processId" ]; then
echo "关闭应用:${project.artifactId}-${project.version} - $processId" echo "关闭应用:${project.artifactId}-${project.version} - $processId"
while [ ! -z "$processId" ] while [ ! -z "$processId" ]
@@ -21,7 +21,7 @@ if [ ! -z "$processId" ]; then
fi fi
sleep 1 sleep 1
killIndex=$((killIndex+1)) killIndex=$((killIndex+1))
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk "{print $2}") processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
done done
echo "" echo ""
fi fi

View File

@@ -4,20 +4,25 @@
# 等待任务 # # 等待任务 #
######################### #########################
# 休眠一秒:等待后台任务调度
sleep 2
aTime=$(date +%s) aTime=$(date +%s)
waitIndex=0
processCt=0 processCt=0
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk "{print $2}") processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
while [ -z "$processId" ] && [ $waitIndex -le 8 ]
do
echo "等待调度:${project.artifactId}-${project.version}"
sleep 1
waitIndex=$((waitIndex+1))
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
done
if [ ! -z "$processId" ]; then if [ ! -z "$processId" ]; then
echo "等待应用${project.artifactId}-${project.version} - $processId" echo "等待启动${project.artifactId}-${project.version} - $processId"
waitIndex=0
processCt=$(netstat -anop | grep $processId | grep LISTEN | wc -l) processCt=$(netstat -anop | grep $processId | grep LISTEN | wc -l)
while [ ! -z "$processId" ] && [ $processCt -lt 1 ] && [ $waitIndex -le 120 ] while [ ! -z "$processId" ] && [ $processCt -lt 1 ] && [ $waitIndex -le 120 ]
do do
sleep 1 sleep 1
waitIndex=$((waitIndex+1)) waitIndex=$((waitIndex+1))
processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk "{print $2}") processId=$(ps -aux | grep "${project.artifactId}" | grep java | awk '{print $2}')
if [ ! -z "$processId" ]; then if [ ! -z "$processId" ]; then
processCt=$(netstat -anop | grep $processId | grep LISTEN | wc -l) processCt=$(netstat -anop | grep $processId | grep LISTEN | wc -l)
else else
@@ -33,8 +38,8 @@ if [ $processCt -lt 1 ]; then
exit 0 exit 0
else else
zTime=$(date +%s) zTime=$(date +%s)
cTime=$((finishTime-aTime)) processTime=$((zTime-aTime))
echo -e "\033[32m启动成功${project.artifactId}-${project.version} - $processId\033[0m" echo -e "\033[32m启动成功${project.artifactId}-${project.version} - $processId\033[0m"
echo "启动端口:$(netstat -anop | grep $processId | grep LISTEN | awk "{print $4}")" echo "启动端口:$(netstat -anop | grep $processId | grep LISTEN | awk '{print $4}')"
echo "启动耗时:$cTime S" echo "启动耗时:$processTime S"
fi fi

View File

@@ -6,7 +6,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.3</version> <version>3.1.0</version>
<relativePath /> <relativePath />
</parent> </parent>
@@ -23,9 +23,9 @@
<properties> <properties>
<!-- 版本 --> <!-- 版本 -->
<java.version>17</java.version> <java.version>17</java.version>
<lombok.version>1.18.26</lombok.version> <lombok.version>1.18.28</lombok.version>
<springdoc.version>2.0.2</springdoc.version> <springdoc.version>2.1.0</springdoc.version>
<mapstruct.version>1.5.2.Final</mapstruct.version> <mapstruct.version>1.5.5.Final</mapstruct.version>
<!-- 配置 --> <!-- 配置 -->
<taoyao.maven.basedir>${project.basedir}</taoyao.maven.basedir> <taoyao.maven.basedir>${project.basedir}</taoyao.maven.basedir>
<taoyao.maven.encoding>UTF-8</taoyao.maven.encoding> <taoyao.maven.encoding>UTF-8</taoyao.maven.encoding>