Skip to content

Commit

Permalink
修复重启系统命令
Browse files Browse the repository at this point in the history
  • Loading branch information
whyour committed Jan 1, 2024
1 parent 71e7ba9 commit 149f9ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 5 additions & 3 deletions back/services/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export default class SystemService {
}

public async updateSystem() {
const cp = spawn('no_tee=true ql update false', { shell: '/bin/bash' });
const cp = spawn('real_time=true ql update false', { shell: '/bin/bash' });

cp.stdout.on('data', (data) => {
this.sockService.sendMessage({
Expand All @@ -311,8 +311,10 @@ export default class SystemService {
}

public async reloadSystem(target: 'system' | 'data') {
const cmd = `no_tee=true ql reload ${target || ''}`;
const cp = spawn(cmd, { shell: '/bin/bash' });
const cmd = `real_time=true ql reload ${target || ''}`;
const cp = spawn(cmd, { shell: '/bin/bash', detached: true });

cp.unref();

cp.stdout.on('data', (data) => {
this.sockService.sendMessage({
Expand Down
3 changes: 3 additions & 0 deletions shell/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,9 @@ main() {
if [[ "$no_tee" == "true" ]]; then
cmd=">> $file_path 2>&1"
fi
if [[ "$real_time" == "true" ]]; then
cmd=""
fi

local time_format="%Y-%m-%d %H:%M:%S"
local time=$(date "+$time_format")
Expand Down
8 changes: 4 additions & 4 deletions src/pages/setting/dependence.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const Dependence = () => {
onClick={() => {
updateSystemConfig('dependence-proxy');
}}
style={{ width: 84 }}
style={{ width: 100 }}
>
{intl.get('确认')}
</Button>
Expand All @@ -149,7 +149,7 @@ const Dependence = () => {
onClick={() => {
updateSystemConfigStream('node-mirror');
}}
style={{ width: 84 }}
style={{ width: 100 }}
>
{intl.get('确认')}
</Button>
Expand All @@ -174,7 +174,7 @@ const Dependence = () => {
onClick={() => {
updateSystemConfig('python-mirror');
}}
style={{ width: 84 }}
style={{ width: 100 }}
>
{intl.get('确认')}
</Button>
Expand All @@ -201,7 +201,7 @@ const Dependence = () => {
onClick={() => {
updateSystemConfigStream('linux-mirror');
}}
style={{ width: 84 }}
style={{ width: 100 }}
>
{intl.get('确认')}
</Button>
Expand Down

0 comments on commit 149f9ca

Please sign in to comment.