Merge pull request #691 from midoks/dev

rsyncd同步-接收优化
This commit is contained in:
Mr Chen
2025-01-08 15:10:57 +08:00
committed by GitHub
2 changed files with 17 additions and 6 deletions
+10 -3
View File
@@ -387,9 +387,16 @@ def addRec():
args_ps = args['ps']
if not mw.isAppleSystem():
os.system("mkdir -p " + args_path + " &")
os.system("chown -R www:www " + args_path + " &")
os.system("chmod -R 755 " + args_path + " &")
if os.path.exists(args_path):
import utils.file as utils_file
info = utils_file.getAccess(args_path)
file_chown = info['chown']
if file_chown != 'www':
return mw.returnJson(False, '建议手动执行命令: chown -R www:www '+ args_path)
else:
os.system("mkdir -p " + args_path + " &")
os.system("chown -R www:www " + args_path + " &")
os.system("chmod -R 755 " + args_path + " &")
delRecBy(args_name)
+7 -3
View File
@@ -667,9 +667,13 @@ function addReceive(name = ""){
var loadT = layer.msg('正在获取...', { icon: 16, time: 0, shade: 0.3 });
rsPost('add_rec', args, function(data){
var rdata = $.parseJSON(data.data);
layer.close(loadOpen);
layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']});
setTimeout(function(){rsyncdReceive();},2000);
if (rdata['status']){
layer.close(loadOpen);
layer.msg(rdata.msg,{icon:rdata.status?1:2,time:2000,shade: [0.3, '#000']});
setTimeout(function(){rsyncdReceive();},2000);
} else {
layer.msg(rdata.msg,{icon:rdata.status?1:2,time:10000,shade: [0.3, '#000']});
}
});
}
});