Code: small refactor, HA template: TCP backend fix
gitea/docker-discover/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-02-22 18:50:03 +01:00
parent 762fbffe3c
commit a437b28cb0
2 changed files with 5 additions and 4 deletions

View File

@ -33,10 +33,6 @@ async function updateProxy(firstRun) {
};
}
function sortFn(a, b) {
return a.name > b.name ? 1 : a.name < b.name ? -1 : 0;
}
const workers = [];
const managers = [];
@ -85,6 +81,10 @@ async function updateProxy(firstRun) {
}
}
function sortFn(a, b) {
return a.name > b.name ? 1 : a.name < b.name ? -1 : 0;
}
for (const list of [workers, managers, http, tcp, udp])
list.sort(sortFn);

View File

@ -49,6 +49,7 @@ backend {{name}}
{{#each tcp}}
listen {{name}}:{{port}}
bind :{{port}}
mode tcp
{{#each ../workers}}
server {{name}} {{address}}:{{../port}} check