<commit_before>#!/bin/bash

export JAVA_HOME=/usr/lib/jvm/jdk8

MYSQL_NUM=`ps -ef | grep mysql | grep -v 'grep' | wc -l`
if [ "x$MYSQL_NUM" != "x2" ];then
	service mysqld start
fi

NGINX_NUM=`ps -ef | grep nginx | grep -v 'grep' | wc -l`
if [ "x$NGINX_NUM" != "x2" ];then
	/usr/sbin/nginx
fi

HTTP_CODE=`curl -w %{http_code} http://localhost:8080/zuoxiaolong`
if [ "$HTTP_CODE" == "302" ];then
	exit 0
fi
ps -ef | grep java | grep -v 'grep' | awk '{print "kill -9 " $2}' | sh
sleep 2
su - xiaolongzuo -c "/app/apache-tomcat-8.0.21/bin/startup.sh"
CURRENT=`date`
echo "$CURRENT restart." >> /home/xiaolongzuo/logs/restart.log
chown xiaolongzuo.xiaolongzuo /home/xiaolongzuo/logs/restart.log<commit_msg>polish<commit_after>#!/bin/bash

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64

MYSQL_NUM=`ps -ef | grep mysql | grep -v 'grep' | wc -l`
if [ "x$MYSQL_NUM" != "x2" ];then
	service mysqld start
fi

NGINX_NUM=`ps -ef | grep nginx | grep -v 'grep' | wc -l`
if [ "x$NGINX_NUM" != "x2" ];then
	/usr/sbin/nginx
fi

HTTP_SERVER_CODE=`curl -I -o /dev/null -s -w %{http_code} http://localhost:8888/tag/getHotTags`
if [ "$HTTP_CODE" != "200" ];then
	ps -ef | grep "personal-blog-webapp-server.jar" | grep -v 'grep' | awk '{print "kill -9 " $2}' | sh
    sleep 2
    su - zuoxiaolong -c "java -Xms128m -Xms128m -Dspring.config.location=classpath:application.yml,/home/zuoxiaolong/personal-blog-webapp-server/application-product.yml -jar personal-blog-webapp-server.jar"
    CURRENT=`date`
    echo "$CURRENT restart." >> /home/zuoxiaolong/personal-blog-webapp-server/logs/restart.log
    chown zuoxiaolong.zuoxiaolong /home/zuoxiaolong/personal-blog-webapp-server/logs/restart.log
fi

HTTP_CODE=`curl -w %{http_code} http://localhost:8080/personal-blog-webapp-site`
if [ "$HTTP_CODE" == "302" ];then
	exit 0
fi
ps -ef | grep "org.apache.catalina.startup.Bootstrap" | grep -v 'grep' | awk '{print "kill -9 " $2}' | sh
sleep 2
su - zuoxiaolong -c "/home/zuoxiaolong/apache-tomcat-8.0.21/bin/startup.sh"
CURRENT=`date`
echo "$CURRENT restart." >> /home/zuoxiaolong/apache-tomcat-8.0.21/logs/restart.log
chown zuoxiaolong.zuoxiaolong /home/zuoxiaolong/apache-tomcat-8.0.21/logs/restart.log
{'fraction_non_alphanumeric': 0.17806977797915724, 'fraction_numerical': 0.0348889895786135, 'mean_word_length': 3.8849557522123894, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7418138', 'n_tokens_mistral': 1030, 'n_tokens_neox': 937, 'n_words': 190}