删除额外日志

This commit is contained in:
hanhh 2021-05-21 18:54:15 +08:00
parent 12216abcff
commit 4958d700de
3 changed files with 8 additions and 7 deletions

View File

@ -199,17 +199,17 @@ export default class CronService {
); );
cmd.stdout.on('data', (data) => { cmd.stdout.on('data', (data) => {
this.logger.info(`stdout: ${data}`); this.logger.silly(`stdout: ${data}`);
fs.appendFileSync(logFile, data); fs.appendFileSync(logFile, data);
}); });
cmd.stderr.on('data', (data) => { cmd.stderr.on('data', (data) => {
this.logger.info(`stderr: ${data}`); this.logger.silly(`stderr: ${data}`);
fs.appendFileSync(logFile, data); fs.appendFileSync(logFile, data);
}); });
cmd.on('close', (code) => { cmd.on('close', (code) => {
this.logger.info(`child process exited with code ${code}`); this.logger.silly(`child process exited with code ${code}`);
this.cronDb.update( this.cronDb.update(
{ _id }, { _id },
{ $set: { status: CrontabStatus.idle }, $unset: { pid: true } }, { $set: { status: CrontabStatus.idle }, $unset: { pid: true } },
@ -222,7 +222,7 @@ export default class CronService {
}); });
cmd.on('exit', (code: number, signal: any) => { cmd.on('exit', (code: number, signal: any) => {
this.logger.info(`cmd exit ${code}`); this.logger.silly(`cmd exit ${code}`);
this.cronDb.update( this.cronDb.update(
{ _id }, { _id },
{ $set: { status: CrontabStatus.idle }, $unset: { pid: true } }, { $set: { status: CrontabStatus.idle }, $unset: { pid: true } },

View File

@ -265,7 +265,7 @@ update_qinglong() {
reset_romote_url ${ql_static_repo} ${url} reset_romote_url ${ql_static_repo} ${url}
git fetch --all git fetch --all
exit_status=$? exit_status=$?
git reset --hard origin/master >/dev/null 2>&1 git reset --hard origin/master
else else
git_clone_scripts ${url} ${ql_static_repo} git_clone_scripts ${url} ${ql_static_repo}
fi fi
@ -279,6 +279,7 @@ update_qinglong() {
cp -rf $ql_static_repo/* $dir_root cp -rf $ql_static_repo/* $dir_root
echo -e "重启面板中..." echo -e "重启面板中..."
nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf nginx -s reload 2>/dev/null || nginx -c /etc/nginx/nginx.conf
sleep 1
pm2 reload all >/dev/null 2>&1 pm2 reload all >/dev/null 2>&1
else else
echo -e "\n更新$dir_root失败,请检查原因...\n" echo -e "\n更新$dir_root失败,请检查原因...\n"

View File

@ -103,7 +103,7 @@ const Crontab = () => {
align: 'center' as const, align: 'center' as const,
render: (text: string, record: any) => ( render: (text: string, record: any) => (
<> <>
{!record.isDisabled && ( {(!record.isDisabled || record.status !== CrontabStatus.idle) && (
<> <>
{record.status === CrontabStatus.idle && ( {record.status === CrontabStatus.idle && (
<Tag icon={<ClockCircleOutlined />} color="default"> <Tag icon={<ClockCircleOutlined />} color="default">
@ -125,7 +125,7 @@ const Crontab = () => {
)} )}
</> </>
)} )}
{record.isDisabled === 1 && ( {record.isDisabled === 1 && record.status === CrontabStatus.idle && (
<Tag icon={<CloseCircleOutlined />} color="error"> <Tag icon={<CloseCircleOutlined />} color="error">
</Tag> </Tag>