mirror of
https://gitlab.com/ryzen-controller-team/ryzen-controller.git
synced 2024-12-22 10:03:28 +07:00
#14 Workaround error by retrying 3 times when the command fail.
This commit is contained in:
parent
2654786160
commit
1f5c439def
12
js/app.js
12
js/app.js
@ -29,6 +29,7 @@ ready(function(){
|
||||
*/
|
||||
function applyRyzenSettings() {
|
||||
const settings = getCurrentSettings("ryzenadjArgs");
|
||||
const appSettings = require('electron-settings');
|
||||
|
||||
const child = require('child_process').execFile;
|
||||
const executablePath = getRyzenAdjExecutablePath();
|
||||
@ -65,9 +66,20 @@ function applyRyzenSettings() {
|
||||
}
|
||||
}
|
||||
|
||||
if (!appSettings.get('retry')) {
|
||||
appSettings.set('retry', 2);
|
||||
notification('warning', 'Applying settings...');
|
||||
} else {
|
||||
let retry = appSettings.get('retry') - 1;
|
||||
appSettings.set('retry', retry);
|
||||
}
|
||||
child(executablePath, parameters, function(err, data) {
|
||||
var output = data.toString();
|
||||
if (err) {
|
||||
let retry = appSettings.get('retry');
|
||||
if (retry) {
|
||||
return applyRyzenSettings();
|
||||
}
|
||||
notification('danger', err + '<br/>' + output);
|
||||
}
|
||||
else if (output) {
|
||||
|
Loading…
Reference in New Issue
Block a user