修改 nginx body 限制,服务重启延迟时间

This commit is contained in:
whyour 2023-07-18 15:30:43 +08:00
parent db94cd3799
commit 4e091b0c3e
6 changed files with 7 additions and 15 deletions

View File

@ -25,7 +25,6 @@ import {
import { TASK_COMMAND } from '../config/const'; import { TASK_COMMAND } from '../config/const';
import taskLimit from '../shared/pLimit'; import taskLimit from '../shared/pLimit';
import tar from 'tar'; import tar from 'tar';
import fs from 'fs';
import path from 'path'; import path from 'path';
@Service() @Service()
@ -258,13 +257,7 @@ export default class SystemService {
public async exportData(res: Response) { public async exportData(res: Response) {
try { try {
await tar.create({ gzip: true, file: config.dataTgzFile, cwd: config.rootPath }, ['data']) await tar.create({ gzip: true, file: config.dataTgzFile, cwd: config.rootPath }, ['data'])
const dataFile = fs.createReadStream(config.dataTgzFile); res.download(config.dataTgzFile);
res.writeHead(200, {
'Content-Type': 'application/force-download',
'Content-Disposition': 'attachment; filename=data.tgz',
'Content-length': fs.statSync(config.dataTgzFile).size
});
dataFile.pipe(res);
} catch (error: any) { } catch (error: any) {
return res.send({ code: 400, message: error.message }); return res.send({ code: 400, message: error.message });
} }

View File

@ -14,7 +14,7 @@ http {
server_tokens off; server_tokens off;
client_max_body_size 20m; client_max_body_size 4096m;
client_body_buffer_size 20m; client_body_buffer_size 20m;
keepalive_timeout 65; keepalive_timeout 65;

View File

@ -244,7 +244,6 @@ reload_qinglong() {
fi fi
if [[ "$reload_target" == 'data' ]]; then if [[ "$reload_target" == 'data' ]]; then
rm -rf ${dir_data}
cp -rf ${dir_tmp}/data ${dir_root}/ cp -rf ${dir_tmp}/data ${dir_root}/
fi fi

View File

@ -138,7 +138,7 @@ const CheckUpdate = ({ socketMessage, systemInfo }: any) => {
<Countdown <Countdown
className="inline-countdown" className="inline-countdown"
format="ss" format="ss"
value={Date.now() + 1000 * 15} value={Date.now() + 1000 * 30}
/> />
</span> </span>
@ -147,7 +147,7 @@ const CheckUpdate = ({ socketMessage, systemInfo }: any) => {
}); });
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();
}, 14000); }, 30000);
}) })
.catch((error: any) => { .catch((error: any) => {
console.log(error); console.log(error);

View File

@ -136,7 +136,7 @@ const Other = ({
<Countdown <Countdown
className="inline-countdown" className="inline-countdown"
format="ss" format="ss"
value={Date.now() + 1000 * 15} value={Date.now() + 1000 * 30}
/> />
</span> </span>
@ -145,7 +145,7 @@ const Other = ({
}); });
setTimeout(() => { setTimeout(() => {
window.location.reload(); window.location.reload();
}, 14000); }, 30000);
}) })
.catch((error: any) => { .catch((error: any) => {
console.log(error); console.log(error);

View File

@ -239,7 +239,7 @@ const SecuritySettings = ({ user, userChange }: any) => {
</div> </div>
<Avatar size={128} shape="square" icon={<UserOutlined />} src={avatar} /> <Avatar size={128} shape="square" icon={<UserOutlined />} src={avatar} />
<ImgCrop rotate> <ImgCrop rotationSlider>
<Upload <Upload
method="put" method="put"
showUploadList={false} showUploadList={false}